Essential Linux Commands for Developers and Sysadmins: From Basic Navigation to Performance Monitoring
Whether you are managing a production cloud server or setting up a local development environment, mastering the command line is an essential skill for any developer or system administrator. Graphical tools are great for daily tasks, but the Linux shell gives you precise control, speed and automation that a GUI cannot match.
This guide covers the most important Linux commands grouped by task, from basic navigation to performance monitoring and troubleshooting. Each section includes a practical example and the mistakes beginners make most often.
1. File and directory navigation
Moving efficiently through the filesystem is the foundation of shell work.
pwdprints the absolute path of your current directory.lslists files and folders. Usels -lato show hidden files (names starting with a dot) along with permissions, owners and sizes.cdchanges directory.cd ..moves up one level,cdalone returns to your home directory, andcd -jumps back to the previous directory.mkdircreates a directory.mkdir -p project/assetscreates nested folders in one command.
2. File manipulation and management
Creating, moving and editing files from the terminal saves time during deployments.
cpcopies files. Usecp -rto copy a directory with its contents.mvmoves or renames a file, for examplemv oldname.txt newname.txt.rmdeletes files. Be extremely careful withrm -rf, which removes directories recursively without asking. Runlson the exact path first, and never paste a delete command you do not fully understand.touchcreates an empty file or updates the timestamp of an existing one.
3. Permissions and ownership
Many "permission denied" errors come from wrong ownership or access rights. Every file has read (4), write (2) and execute (1) permissions for the owner, the group and everyone else. Add the numbers together for each group.
chmod 644 file.txtlets the owner read and write, while others can only read.chmod 755 script.shlets the owner do everything, while others can read and execute.chmod +x script.shmakes a script executable.sudo chown user:group file.txtchanges the owner and group of a file.sudoruns a single command with administrator rights. Prefer it over logging in as root, because it is safer and leaves an audit trail.
Avoid the lazy fix of chmod 777. It gives every user full access and is a common security mistake.
4. Searching and filtering data
Finding text inside logs and configuration files is a daily task for administrators.
grepsearches for patterns. For example,grep -i "error" /var/log/syslogfinds errors regardless of case, andgrep -rn "timeout" /etc/nginxsearches a folder recursively and shows line numbers.findlocates files by name, size or date, such asfind /var/www -name "*.conf"orfind /var -size +100Mto hunt for large files.catandlessshow file contents. Usecatfor short files andlessfor long ones so you can scroll page by page.tail -f /var/log/syslogfollows a log file live, which is perfect while testing a fix.
5. Process and system monitoring
When a server slows down or an application crashes, you need to know what is using CPU and memory.
topandhtopshow live processes, CPU use, memory and load averages.htophas a friendlier, colour-coded interface.uptimeshows how long the system has been running and its load averages.free -hshows memory and swap usage in readable units.ps auxlists every running process. Combine it with grep, as inps aux | grep nginx.killstops a process by its ID. Start with the polite version,kill 1234, which lets the program shut down cleanly. Usekill -9 1234only as a last resort, because it ends the process instantly without cleanup.killall nameandpkill namework by process name.
6. Disk usage
A full disk is one of the most common causes of mysterious server failures.
df -hshows free and used space for each mounted filesystem.du -sh /var/logshows how much space a folder uses. Rundu -sh *inside a directory to see which item is the biggest.
7. Services and logs
Modern Linux distributions manage services with systemd.
sudo systemctl status nginxshows whether a service is running.sudo systemctl restart nginxrestarts it, andsudo systemctl enable nginxmakes it start at boot.journalctl -u nginx -n 50shows the last 50 log lines for that service, andjournalctl -u nginx -ffollows them live.
8. Network diagnostics
Checking ports, routes and remote connections is vital for secure server infrastructure.
ss -tulnlists listening TCP and UDP ports. Add-pwith sudo to see which process owns each port. The oldernetstatdoes the same job, but it is no longer installed by default on many distributions, so learnssfirst.ip addrshows your network interfaces and IP addresses.curltests web endpoints and APIs.curl -I https://example.comshows only the response headers.wgetdownloads files.ping -c 4 example.comtests basic reachability and latency.
9. Archives and backups
The tar command bundles and compresses files. Create an archive with tar -czf backup.tar.gz /var/www and extract it with tar -xzf backup.tar.gz.
A simple troubleshooting routine
When someone says "the server is slow", work through the same short checklist every time:
- Run
uptimeandtopto check the load and the busiest processes. - Run
free -hto see whether memory or swap is exhausted. - Run
df -hto make sure no disk is full. - Run
journalctl -u servicename -n 50to read recent errors. - Run
sudo ss -tulnpto confirm the right ports are open.
Getting help
You do not need to memorise every option. Type man command for the full manual, or command --help for a short summary, and press Tab to autocomplete file names and commands.
Summary
Mastering these commands turns the command line from an intimidating black box into a powerful toolkit. Learn them by category, practise on a test machine, and be careful with anything that deletes or changes permissions. For more practical infrastructure guides, read my articles on securing Linux servers and setting up SSH keys safely.