Essential Linux System Administration Commands and How They Work
The Linux commands system administrators use most cover a handful of tasks: checking the system ( uname, hostnamectl, uptime), managing processes ( ps, top, kill), controlling services ( systemctl), reading logs ( journalctl), managing disks ( df, du, lsblk), handling users and permissions ( useradd, chmod, chown), installing packages ( dnf or apt), checking networking ( ip, ss) and scheduling jobs ( cron, systemd…
Topic: Linux Administration in IT Infrastructure · Commands & reference
Quick answer: The Linux commands system administrators use most cover a handful of tasks: checking the system (uname, hostnamectl, uptime), managing processes (ps, top, kill), controlling services (systemctl), reading logs (journalctl), managing disks (df, du, lsblk), handling users and permissions (useradd, chmod, chown), installing packages (dnf or apt), checking networking (ip, ss) and scheduling jobs (cron, systemd timers). Learning them by task is faster than memorising lists.
Key takeaways
systemctlandjournalctlare central on systemd distributions.- Use
manand--helpto check options before running commands. - Prefer least privilege: use sudo for specific commands, not a root shell.
- Check disk and memory early when troubleshooting performance.
- Test destructive commands with dry runs where available.
Table of Contents
- Which Commands Show System Information?
- How Do You Manage Processes and Services?
- How Do You Read Logs?
- How Do You Manage Disks and Files?
- How Do You Manage Users and Permissions?
- How Do You Install and Update Software?
- How Do You Schedule Tasks?
- What Safety Habits Matter?
- References
Which Commands Show System Information?
hostnamectl # hostname, OS, kernel
uname -r # kernel version
uptime # uptime and load average
free -h # memory usage
lscpu # CPU details
cat /etc/os-release # distribution and version
How Do You Manage Processes and Services?
ps aux --sort=-%mem | head # top memory users
top # live view (q to quit)
kill PID # ask a process to stop; kill -9 only as last resort
sudo systemctl status nginx # service state and recent logs
sudo systemctl restart nginx
sudo systemctl enable --now nginx # start now and at boot
systemctl list-units --failed # failed services
See the systemctl manual.
How Do You Read Logs?
journalctl -u nginx --since "1 hour ago" # one service
journalctl -p err -b # errors since boot
journalctl -f # follow new entries
sudo tail -f /var/log/auth.log # Debian/Ubuntu authentication log
sudo tail -f /var/log/secure # RHEL authentication log
How Do You Manage Disks and Files?
df -h # free space per filesystem
du -sh /var/* | sort -h # what is using space
lsblk # disks and partitions
findmnt # mounted filesystems
find /var/log -name "*.gz" -mtime +30 # old compressed logs
How Do You Manage Users and Permissions?
sudo useradd -m -s /bin/bash priya && sudo passwd priya
sudo usermod -aG wheel priya # RHEL admin group (sudo group on Ubuntu)
id priya
chmod 640 config.yml # owner rw, group r
sudo chown app:app /srv/app -R
sudo visudo # edit sudo rules safely
See Linux users and permissions.
How Do You Install and Update Software?
| Task | RHEL/Fedora | Debian/Ubuntu |
|---|---|---|
| Update all | sudo dnf upgrade | sudo apt update && sudo apt upgrade |
| Install | sudo dnf install htop | sudo apt install htop |
| Search | dnf search nginx | apt search nginx |
| Which package owns a file | rpm -qf /usr/bin/ss | dpkg -S /usr/bin/ss |
How Do You Schedule Tasks?
crontab -e
# run a backup script at 02:30 every day
30 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
systemctl list-timers # systemd timers
What Safety Habits Matter?
- Read the man page before unfamiliar commands.
- Double-check paths in
rm,chmod -Randchown -R. - Use
rsync --dry-runbefore large copies or deletions. - Back up configuration files before editing.
- Avoid running scripts piped from the internet without reading them.
Related: Linux server hardening and finding which process uses a port. WebAsha offers RHCSA and Linux courses.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0