Published
Reading Time
2 min read
Linux Commands Every Developer Should Know
Linux Commands Every Software Developer Should Know.
Having spent the majority of my more recent workdays wrangling containers and navigating Linux systems in a variety of fashions it's become clear to me that there are some commands that every Software Developer working in a unix environment should know. Below are a list of some of those commands that I use on a day to day basis which can be incredibly helpful.
sed — Stream Editor
Use sed to find and replace text across files without opening them in an editor.
# Linux variant
$ sed -i 's/jeff/ben/g' ourfile.txt
# MacOS variant
$ sed -i '' 's/jeff/ben/g' ourfile.txt
cat — Concatenate and Print Files
$ cat ourfile.txt
head and tail — View File Portions
# Get the first 200 lines of a file
$ head -200 ourfile.txt
# Get the last 200 lines of a file
$ tail -200 ourfile.txt
sed — Range Selection
# Get the next 300 lines after line 40
$ sed -n '40,300 p' ourfile.txt
scp — Secure Copy
# Copy a file from your local machine to a remote server
$ scp our-local-file.txt youruser@serverip:/remote/directory
# Copy a file from a remote server to your local machine
$ scp youruser@serverip:/remote/directory ~/Documents
chown and chmod — Ownership and Permissions
# Change the ownership of a directory and its subdirectories and files
$ chown -R user:group directory
# Change the ownership of a single file
$ chown user:group file
# Make a file executable, useful for bash scripts
$ chmod +x yourscript.sh
# Only the owner can read, write and execute; no one else has permissions
$ chmod 700 yourfile
# Only the owner can read and write; no one else has permissions
$ chmod 600 yourfile
# Owner can read and write; group and world can only read
$ chmod 644 yourfile
zip — Compress Files
# Install the zip utility
$ apt-get install zip
# Zip the directory and its contents
$ zip -r newfilename.zip yourfolder
nohup — Run Processes in the Background
$ nohup yourscript.sh &
The nohup command lets a process continue running even after you log out of the shell session, with & sending it to the background immediately.
Written by
Ben Durham-Kilcullen
Chief AI Officer at Ondaro · Forbes Technology Council · Founder, Kilcullen Technologies
Technology executive with a deep foundation in data science and software engineering. Dedicated to translating complex technical insights into impactful business strategies across healthcare, financial services, and enterprise software.