10 Essential Linux Commands Every SysAdmin Should Know

10 Essential Linux Commands Every SysAdmin Should Know

As a Linux System Administrator, mastering the command line is key to efficiently managing servers, troubleshooting issues, and automating tasks. Whether you’re working with bare metal, cloud VMs, or containerized environments, these 10 Linux commands are the backbone of daily sysadmin operations.


1. ls – List Directory Contents

The ls command lists files, directories, and their attributes.

ls -lah
  • -l → detailed (long) listing
  • -a → include hidden files
  • -h → human-readable file sizes

Tip: Combine it with sort or grep to find files quickly.


2. cd – Change Directory

Switch directories easily with cd.

cd /var/log

Shortcut: cd - → go back to the previous directory.


3. grep – Search Inside Files

grep searches for text patterns within files.

grep -Ri "error" /var/log/
  • -R → recursive search
  • -i → case-insensitive

Use case: Perfect for scanning logs or config files for keywords.


4. top / htop – Monitor System Processes

Monitor performance and resource usage in real-time.

top

Or install the enhanced version:

htop

View CPU, memory, and process usage, and interactively manage processes.


5. df – Disk Space Usage

Quickly check disk space usage.

df -h
  • -h → human-readable output
  • df -Th → show filesystem types

6. du – Disk Usage per Directory

Find which directories consume the most space.

du -sh /var/*

Combine with sort for better insight:

du -sh * | sort -h

7. tar – Archive and Extract Files

Create or extract compressed files.

# Create archive
tar -czvf backup.tar.gz /etc

# Extract archive
tar -xzvf backup.tar.gz
  • c → create
  • x → extract
  • z → gzip compression
  • v → verbose
  • f → file

8. chmod & chown – Manage Permissions

Set or change file permissions and ownership.

chmod 644 file.txt
chown root:root file.txt

Tip: Always double-check permissions before changing system files.


9. systemctl – Manage Services

Control services and daemons on systemd-based distributions.

systemctl status nginx
systemctl restart sshd
systemctl enable mariadb

Actions: start, stop, restart, status, enable, disable


10. journalctl – View System Logs

Access and filter logs stored by systemd.

journalctl -u nginx --since "1 hour ago"
  • -u → specific service
  • --since / --until → filter by time range

Bonus Tip: Combine Commands with Pipes (|)

Chain commands together to process data efficiently:

ps aux | grep nginx | awk '{print $2}'

This example finds all Nginx process IDs — showcasing the power of Linux pipelines.


Conclusion

These 10 Linux commands form the foundation of system administration. Once you’re comfortable with them, you’ll troubleshoot faster, automate routine tasks, and manage complex systems with confidence.

If you’re new to Linux or preparing for certifications like LFCS or RHCSA, mastering these commands is your first step toward becoming a professional sysadmin.

Tags: Linux, SysAdmin, Command Line, Tutorial, Tips

Category: Linux Basics