LinuxIntermediate

Essential Linux Commands Every Developer Should Know

A practical reference for the Linux commands you'll actually reach for day to day — file navigation, process management, and text processing.

DevFieldGuideJune 22, 2026 (updated July 24, 2026)6 min read
Share:

Not a full manual — just the commands that come up constantly once you're regularly working in a terminal.

bash
pwd                     # print working directory
ls -la                  # list all files, including hidden, with details
cd /path/to/dir         # change directory
find . -name "*.log"    # find files by name pattern, recursively

Searching inside files

bash
grep -r "TODO" src/           # search recursively for a string
grep -rn "TODO" src/          # same, with line numbers
grep -riE "error|fail" app.log  # case-insensitive, extended regex

grep is one of the highest-leverage commands to actually know well — being fast at searching logs and codebases from the terminal saves real time over reaching for a GUI search tool every time.

Process management

bash
ps aux                  # list all running processes
ps aux | grep node       # find a specific process
kill -9 <PID>            # force-kill a process by ID
top                      # live view of resource usage
htop                     # nicer interactive version of top (often needs installing)

Disk and memory

bash
df -h                   # disk space, human-readable
du -sh *                # size of each item in the current directory
free -h                 # memory usage, human-readable

Permissions

bash
chmod +x script.sh      # make a file executable
chmod 644 file.txt       # rw for owner, r for group/others
chown user:group file    # change ownership
cat access.logPrints file contents
| grep "500"Filters to matching lines
| wc -lCounts the result

Piping and redirection — where the real power is

bash
cat access.log | grep "500" | wc -l     # count lines containing "500"
ls -la | sort -k5 -n                     # sort files by size
command > output.txt                     # redirect output to a file (overwrite)
command >> output.txt                    # append instead of overwrite
command 2>&1                             # redirect stderr into stdout

The pipe (|) is what makes the command line genuinely powerful — chaining small, single-purpose tools together to do something none of them do alone.

Networking

bash
curl -I https://example.com     # fetch just the response headers
curl -s https://api.example.com/data | jq .   # fetch JSON and pretty-print it
ping -c 4 example.com           # test connectivity, 4 packets
netstat -tulpn                  # list listening ports and the processes using them

SSH and file transfer

bash
ssh user@host                          # connect to a remote machine
scp file.txt user@host:/remote/path/   # copy a file to a remote machine
rsync -avz local/ user@host:/remote/   # sync a directory, only transferring changes

rsync is worth knowing over scp for anything beyond a single file — it only transfers what's changed, which matters a lot for repeated syncs of large directories.

A habit worth building

man <command> and <command> --help answer most "wait, what were the flags for this again" questions faster than searching the web, and work offline. Building the habit of checking there first, before reaching for a search engine, pays off the more time you spend in a terminal.

Windows developers running these same commands day to day almost always do it through WSL2 rather than a native Linux install — worth setting up first if that's your situation.

Text processing: sed, awk, and cut

Beyond grep for searching, three commands cover most day-to-day text transformation without reaching for a script:

bash
sed 's/foo/bar/g' file.txt        # replace all "foo" with "bar"
awk '{print $1, $3}' file.txt      # print the 1st and 3rd whitespace-separated columns
cut -d',' -f2 data.csv             # extract the 2nd comma-separated field

awk in particular is worth knowing at least at this basic column-extraction level — a huge amount of ad hoc log and CSV analysis is just "give me columns 1 and 3 from every line," which awk does in one command without opening the file in an editor or writing a script.

Archiving and compression

bash
tar -czvf archive.tar.gz directory/    # create a compressed archive
tar -xzvf archive.tar.gz               # extract it
tar -tzvf archive.tar.gz               # list contents without extracting

The flag mnemonic worth remembering: c create, x extract, t list, always paired with z (gzip compression), v (verbose output), f (the filename comes next) — tar is one of the few commands where the flags genuinely don't need to be looked up once this pattern is internalized.

Environment variables and shell config

bash
export API_KEY="value"        # set for the current shell session and its children
echo $PATH                    # inspect the current PATH
which node                    # show exactly which binary a command resolves to

exported variables only last for the current shell session unless added to a shell config file (~/.bashrc, ~/.zshrc) — a common point of confusion when a variable set in one terminal tab "disappears" in a new one, which is expected: each new shell session starts fresh unless the variable is defined in a config file that runs on every shell startup.

Job control: running things in the background

bash
long-running-command &     # start in the background, return control immediately
jobs                        # list background jobs in the current shell
fg %1                       # bring job 1 back to the foreground
Ctrl+Z                      # suspend the current foreground job
bg %1                       # resume a suspended job in the background

Worth distinguishing from nohup: a background job started with & still dies when the terminal session ends, while nohup long-running-command & survives the terminal closing — the right tool specifically for something that needs to keep running after you disconnect.

Common mistakes

Common mistakes
  • Reaching for kill -9 by default instead of plain kill first. SIGKILL gives the process zero chance to close file handles, flush writes, or clean up — fine for a genuinely hung process, unnecessarily destructive for one that would respond to a normal termination request.
  • Running rm -rf (especially with a wildcard) without double-checking the current directory and the exact path first — one of the few commands on this list with no undo, and a misplaced space or wrong working directory is the classic way it goes wrong.
  • Forgetting -r when trying to du/cp/rm a directory, or forgetting it's implied differently across commands — the flag conventions aren't perfectly consistent between tools, and assuming they are causes real mistakes.
  • Piping grep output into more grep/awk/sed calls when a single command with the right flags (grep -c, grep -o, extended regex) would do it in one step — not wrong, just worth knowing the shorter path exists.
Advertisement

Frequently Asked Questions

Advertisement
DevFieldGuide
DevFieldGuide

Editorial Team

Practical tutorials and developer tools, written and maintained by the DevFieldGuide team.

Enjoyed this article?

Get the next one straight to your inbox, along with the best of what we publish each week.

Related Articles

More in Linux

View all