50 Linux Commands Every System Administrator Should Know
New Linux servers land on your desk every week, and the terminal remains the fastest way to manage them. Whether you patch systems, troubleshoot outages, or automate deployments, a solid command-line toolkit saves hours of guesswork. This guide collects 50 commands that working sysadmins use daily, grouped by category so you can jump straight to what you need and build real muscle memory.
Table of Contents
- File and Directory Management
- Text Viewing and Processing
- Process Management
- User and Permission Management
- Networking Commands
- Disk and Storage Management
- System Monitoring and Performance
- Package Management
- Archiving and Compression
- System Administration and Scheduling
- FAQ
- Conclusion
Suggested image: A terminal window showing a Linux command prompt with a blinking cursor — filename: linux-terminal-command-prompt.jpg, alt text: “Linux terminal command line interface for system administrators”
File and Directory Management
Sysadmins spend a large share of their time moving, inspecting, and cleaning up files. These five commands cover the basics you will type dozens of times a day.
1. ls — List directory contents
ls shows the files and folders in your current location. Add flags to reveal more detail.
bash
ls -lah /var/log
The -l flag prints a long listing, -a includes hidden files, and -h makes file sizes human-readable.
2. cp — Copy files and directories
Use cp to duplicate files. Add -r when copying folders.
bash
cp -r /etc/nginx /backup/nginx-$(date +%F)
3. mv — Move or rename files
mv relocates files and also renames them, since Linux treats renaming as a move within the same directory.
bash
mv old-config.conf new-config.conf
4. rm — Remove files and directories
rm deletes data permanently, so double-check your target before running it with -r or -f.
bash
rm -rf /tmp/old-build-cache
5. find — Search for files
find locates files by name, size, age, or permissions across an entire directory tree.
bash
find /var/log -name "*.log" -mtime +30 -delete
This command finds and deletes log files older than 30 days.
Text Viewing and Processing
Reading and filtering text — especially logs and config files — is a core sysadmin skill. These commands handle that job efficiently.
6. cat — Display file contents
cat prints a file straight to the terminal, which works well for short files.
bash
cat /etc/hostname
7. less — Page through large files
less opens large files one screen at a time instead of dumping everything at once.
bash
less /var/log/syslog
Press q to quit and /searchterm to search inside the file.
8. grep — Search text with patterns
grep filters lines that match a pattern, which makes it invaluable for scanning logs.
bash
grep -i "error" /var/log/apache2/error.log
The -i flag makes the search case-insensitive.
9. sed — Stream editor for text substitution
sed finds and replaces text directly inside files or piped output.
bash
sed -i 's/OldServerName/NewServerName/g' /etc/httpd/conf/httpd.conf
10. awk — Pattern scanning and text extraction
awk processes structured text column by column, which suits log parsing and report generation.
bash
awk '{print $1, $9}' access.log | sort | uniq -c
Suggested image: Split-screen showing raw log file next to filtered grep output — filename: grep-log-filtering-example.jpg, alt text: “Using grep command to filter Linux log files”
Process Management
Every running program on a Linux system is a process. Knowing how to view and control them keeps servers stable.
11. ps — Report running processes
bash
ps aux | grep nginx
This lists all processes and filters for anything related to nginx.
12. top — Real-time process viewer
top refreshes a live view of CPU and memory usage per process.
bash
top
Press M to sort by memory or P to sort by CPU.
13. kill — Terminate a process
bash
kill -9 4521
The -9 flag forces an immediate stop; try kill without it first for a graceful shutdown.
14. htop — Interactive process manager
htop improves on top with color, scrolling, and mouse support. Install it first if it’s missing.
bash
sudo apt install htop && htop
15. nice — Set process priority
nice controls how much CPU time a process receives relative to others.
bash
nice -n 10 ./backup-script.sh
Lower numbers mean higher priority; the range runs from -20 to 19.
User and Permission Management
Controlling who can access what keeps a system secure. These commands manage accounts and file permissions.
16. chmod — Change file permissions
bash
chmod 750 deploy.sh
This grants the owner read, write, and execute access, the group read and execute, and blocks others entirely.
17. chown — Change file ownership
bash
chown www-data:www-data /var/www/html -R
18. useradd — Create a new user account
bash
sudo useradd -m -s /bin/bash devops-user
The -m flag creates a home directory, and -s sets the default shell.
19. passwd — Set or change a password
bash
sudo passwd devops-user
20. sudo — Run commands with elevated privileges
sudo lets a permitted user execute a command as root without logging in as root directly.
bash
sudo systemctl restart nginx
Suggested image: Diagram showing Linux file permission structure (owner/group/others with read/write/execute) — filename: linux-file-permissions-diagram.jpg, alt text: “Linux chmod permission structure explained”
Networking Commands
Diagnosing connectivity issues and transferring files between servers happens constantly in sysadmin work.
21. ping — Test network connectivity
bash
ping -c 4 google.com
The -c 4 flag limits the test to four packets instead of running indefinitely.
22. netstat — Display network connections
bash
netstat -tulpn
This shows listening ports along with the processes using them. Many distros now favor ss instead.
23. ss — Investigate sockets
ss replaces netstat on modern systems and runs faster on servers with many connections.
bash
ss -tulwn
24. curl — Transfer data from URLs
bash
curl -I https://example.com
The -I flag fetches only the HTTP headers, useful for quick health checks.
25. scp — Securely copy files between hosts
bash
scp report.pdf user@192.168.1.10:/home/user/documents/
scp encrypts the transfer using SSH, so it works safely over untrusted networks.
Disk and Storage Management
Running out of disk space causes more outages than almost anything else. These commands help you stay ahead of it.
26. df — Report disk space usage
bash
df -h
27. du — Estimate file and folder sizes
bash
du -sh /var/*
This lists the total size of every top-level folder under /var, sorted by whichever folder you check.
28. mount — Attach a filesystem
bash
sudo mount /dev/sdb1 /mnt/data
29. fdisk — Partition a disk
bash
sudo fdisk -l
Run fdisk /dev/sdb (without -l) to enter interactive partitioning mode — proceed carefully, since mistakes here can erase data.
30. lsblk — List block devices
bash
lsblk
lsblk displays a tree of disks and partitions, which helps confirm device names before running risky commands.
Suggested image: Terminal output of df -h showing disk usage percentages across mounted volumes — filename: linux-disk-usage-df-command.jpg, alt text: “Checking Linux disk space with df command”
System Monitoring and Performance
When a server slows down, these commands help you find the bottleneck quickly.
31. uptime — Show system load and uptime
bash
uptime
The output includes load averages for the last 1, 5, and 15 minutes.
32. free — Display memory usage
bash
free -h
33. vmstat — Report virtual memory statistics
bash
vmstat 2 5
This prints five reports, two seconds apart, covering CPU, memory, and I/O activity.
34. iostat — Monitor disk I/O
bash
iostat -x 2
iostat ships in the sysstat package on most distributions, so install that first if the command isn’t found.
35. dmesg — Print kernel ring buffer messages
bash
dmesg | tail -50
This is often the first place to check after a hardware error or unexpected reboot.
Package Management
Installing, updating, and removing software correctly keeps systems consistent and secure.
36. apt — Manage packages on Debian/Ubuntu
bash
sudo apt update && sudo apt upgrade -y
37. yum / dnf — Manage packages on RHEL/Fedora
bash
sudo dnf update -y
dnf has replaced yum on newer RHEL and Fedora releases, though yum still works as an alias on many systems.
38. rpm — Query and install RPM packages directly
bash
rpm -qa | grep openssl
39. dpkg — Manage .deb packages directly
bash
sudo dpkg -i custom-app.deb
Use dpkg when you have a standalone .deb file rather than a repository package.
40. snap — Install sandboxed applications
bash
sudo snap install docker
Snap packages bundle their own dependencies, which trades some disk space for simpler installs.
Archiving and Compression
Backups, log rotation, and file transfers usually involve compressing data first.
41. tar — Bundle files into an archive
bash
tar -czvf backup-2026.tar.gz /var/www/html
The flags stand for create, gzip, verbose, and file.
42. gzip — Compress a single file
bash
gzip access.log
43. zip — Create a .zip archive
bash
zip -r website-backup.zip /var/www/html
44. rsync — Sync files efficiently
bash
rsync -avz /data/ user@backupserver:/data/
rsync only transfers changed portions of files, which makes repeat backups much faster than a full copy.
45. unzip — Extract a .zip archive
bash
unzip website-backup.zip -d /var/www/html
Suggested image: Flowchart showing a backup workflow — tar compress, rsync transfer, remote server storage — filename: linux-backup-workflow-diagram.jpg, alt text: “Linux server backup workflow using tar and rsync”
System Administration and Scheduling
The final set of commands covers service management and task automation, both core to daily operations.
46. systemctl — Manage system services
bash
sudo systemctl status nginx
sudo systemctl restart nginx
sudo systemctl enable nginx
enable makes sure a service starts automatically on boot.
47. journalctl — View systemd logs
bash
journalctl -u nginx --since "1 hour ago"
48. crontab — Schedule recurring tasks
bash
crontab -e
Add a line like 0 2 * * * /home/user/backup.sh to run a backup script every day at 2 AM.
49. service — Control services on older init systems
bash
sudo service mysql restart
Many distributions now route this through systemctl behind the scenes, but the service command still works for compatibility.
50. shutdown / reboot — Power off or restart a system
bash
sudo shutdown -r now
Add a time delay instead of now — for example sudo shutdown -r +10 — to warn logged-in users before a restart.
FAQ
Do I need to memorize all 50 commands? No. Focus on the ones tied to your daily tasks first — ls, grep, ps, chmod, and systemctl cover most routine work. The rest become familiar through regular use.
Which distribution do these commands work on? Nearly all of them are distribution-agnostic. Package managers differ — use apt on Debian/Ubuntu and dnf or yum on RHEL/Fedora — but everything else runs the same way across major Linux distributions.
What’s the safest way to practice these commands? Set up a virtual machine or a free-tier cloud instance and practice there. Avoid testing destructive commands like rm -rf or dd on production systems.
Is ss fully replacing netstat? Yes, most modern distributions deprecate netstat in favor of ss, which reads socket information faster and stays actively maintained.
How do I know if a command is installed? Run which commandname or command -v commandname. If nothing returns, install the relevant package through your distribution’s package manager.
Conclusion
These 50 commands form the daily toolkit for Linux system administration, spanning file management, process control, networking, storage, monitoring, package handling, archiving, and service scheduling. You don’t need to master every flag overnight — start with the commands that match your current tasks, keep this guide handy as a reference, and build fluency through repetition. Once these become second nature, tackling unfamiliar server issues gets noticeably faster and less stressful.
Want more articles and tutorials like this?
Get new tutorials, security alerts, and IT tips straight to your inbox.