10 Essential Linux Commands Every Server Administrator Should Know
Whether you're managing a single VPS or a fleet of bare-metal servers, the command line is your most powerful tool. These 10 Linux commands form the foundation of effective server administration — from diagnosing performance issues to managing processes and disk space.
1. top / htop — Real-Time Process Monitoring
top shows a live view of running processes, CPU usage, memory consumption, and load averages. htop is an enhanced, colour-coded version that's easier to navigate. Install htop with apt install htop or yum install htop.
Use it when: Your server feels slow and you need to identify what's consuming resources.
2. df -h — Disk Space Usage
Displays disk space usage for all mounted filesystems in human-readable format. A server with a full disk can cause application crashes, failed writes, and service outages.
Use it when: Diagnosing storage issues or doing routine capacity checks.
3. du -sh * — Directory Size Breakdown
Shows the size of each file and directory in the current path. Combine with sort -rh | head -10 to find the top 10 largest items quickly.
4. ss -tulnp — Open Ports and Listening Services
Replaced the older netstat command on modern systems. Lists all TCP and UDP ports that are actively listening, along with the associated process. Essential for security audits and debugging connectivity issues.
5. journalctl -xe — System Logs
Queries the systemd journal for logs. The -xe flags jump to the end of the log and show extended context — perfect for diagnosing a service that just failed to start.
Pro tip: Filter by service with journalctl -u nginx --since "1 hour ago".
6. systemctl — Manage Services
The primary tool for controlling systemd services. Key subcommands include:
systemctl status nginx— check service statussystemctl restart nginx— restart a servicesystemctl enable nginx— auto-start on bootsystemctl list-units --type=service— list all services
7. free -h — Memory Usage
Displays total, used, free, shared, and available memory in human-readable units. Pay attention to the available column — it reflects how much memory can actually be allocated to new processes.
8. curl — HTTP Testing from the Terminal
An incredibly versatile tool for testing web endpoints, APIs, and connectivity. Use curl -I https://yourdomain.com to check HTTP headers, or curl -v for full verbose output including SSL handshake details.
9. rsync — Efficient File Transfer and Backup
More powerful than cp or scp for moving data. rsync only transfers changed blocks, making it ideal for backups and syncing large directories. Example:
rsync -avz /var/www/ user@backup-server:/backups/www/
10. cron / crontab -e — Scheduling Tasks
Automate recurring tasks like backups, log rotation, and health checks. The crontab format is: minute hour day month weekday command. For example, a daily backup at 2am: 0 2 * * * /scripts/backup.sh.
Building Your Toolkit
These commands are just the starting point. As you grow more comfortable at the command line, explore tools like tmux (persistent terminal sessions), awk and sed (text processing), and ansible (configuration management at scale). Consistent practice is the fastest path to server management proficiency.