Linux

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.

Daniel OseiJuly 4, 20263 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

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.

Advertisement
Daniel Osei
Daniel Osei

Security Engineer

Daniel focuses on application security, secure infrastructure, and practical cybersecurity guidance for developers.

Related Articles