Knowing the right Linux commands for server management makes everyday administration easier. Whether you’re monitoring a VPS, troubleshooting a slow website, or managing application services, a few commands can help you identify problems quickly.
This guide covers 25 practical commands with short examples for Ubuntu, Debian, and other common Linux distributions.

New to the terminal? Start with our SSH Commands for Beginners guide to learn how to connect to your server and navigate Linux directories.
1. Check CPU, Memory, and Processes
These commands help you understand how your server is performing.
1. top — Monitor Server Activity
top
Displays running processes, CPU usage, memory consumption, and system load. Press q to exit.
2. free — Check Available Memory
free -h
Shows total, used, and available RAM in a readable format.
3. uptime — Check System Load
uptime
Displays how long the server has been running, active user count, and load averages over 1, 5, and 15 minutes.
4. ps — Find Running Processes
ps aux
Lists running processes with their users, process IDs (PIDs), and resource usage.
5. kill — Stop a Process
kill 1234
Sends a termination signal to process ID 1234. Replace it with the actual PID. Check the process first, because stopping a critical service may cause downtime.
2. Check Disk Space and Files
Disk space problems can interrupt applications, databases, and system updates.
6. df — Check Filesystem Space
df -h
Displays used and available space on mounted filesystems.
7. du — Find Large Directories
du -sh /var/log
Shows the total size of the /var/log directory.
8. find — Locate Files
find /var/log -name "*.log"
Searches for files ending in .log under /var/log.
9. cp — Copy Files
cp config.conf config.conf.bak
Creates a backup copy of a configuration file before editing it.
10. mv — Move or Rename Files
mv old.conf new.conf
Renames a file. Be careful when the destination already exists.
11. rm — Remove Files
rm -i old-backup.txt
Deletes a file after asking for confirmation.
Caution: Linux file deletion generally bypasses the desktop recycle bin. Always verify the path before removing important files.
3. Manage Linux Services and Logs
On Linux distributions using systemd, you can inspect and manage system services.
12. systemctl — Check Service Status
sudo systemctl status nginx
Shows whether Nginx is running and displays recent status information.
To restart it after reviewing your configuration:
sudo systemctl restart nginx
Replace nginx with the relevant service name.
13. journalctl — Read Service Logs
sudo journalctl -u nginx -n 50
Shows the latest 50 journal entries for Nginx.
14. tail — Follow Log Files
sudo tail -f /var/log/nginx/error.log
Displays new entries as they’re written. Press Ctrl+C to stop.
15. grep — Search for Errors
grep -i "error" application.log
Searches a log file for lines containing “error,” ignoring capitalization.
16. less — Read Long Files
less application.log
Opens a long file for scrolling and searching. Press / to search and q to quit.
4. Check Network Connectivity
These commands help diagnose connectivity and DNS problems.
17. ip — View Network Addresses
ip addr show
Displays network interfaces and their assigned IP addresses.
18. ping — Test Connectivity
ping -c 4 1.1.1.1
Sends four ICMP echo requests. Some networks block these requests, so a failed ping doesn’t always mean the destination is unavailable.
19. ss — Check Listening Ports
sudo ss -tuln
Shows listening TCP and UDP sockets with numeric addresses and ports.
20. curl — Check HTTP Responses
curl -I https://example.com
Requests HTTP headers, useful for checking whether a website responds.
Replace example.com with your domain.
5. Manage Permissions and Users
Permissions determine who can access or modify server files.
21. chmod — Change File Permissions
chmod 640 config.conf
Sets read/write access for the owner, read access for the group, and no access for others.
22. chown — Change File Ownership
sudo chown admin:admin config.conf
Changes the file owner and group to admin. Replace these names with the correct account and group.
23. id — Check User Identity
id
Displays your user ID, primary group, and additional group memberships.
6. Check Updates and Server Information
These final commands are useful during routine server maintenance.
24. apt — Review Available Updates
On Ubuntu or Debian:
sudo apt update
apt list --upgradable
Refreshes package information and lists available upgrades. Review changes before applying updates, especially on production servers.
25. uname — Check Kernel Information
uname -r
Displays the running Linux kernel version, useful when investigating compatibility and kernel-related issues.
Linux Server Commands: Quick Reference
| Task | Command |
|---|---|
| Monitor CPU and processes | top |
| Check RAM | free -h |
| Check disk space | df -h |
| Find directory size | du -sh /path |
| Check a service | systemctl status service |
| Read service logs | journalctl -u service |
| View listening ports | ss -tuln |
| Test HTTP response | curl -I URL |
| Check kernel version | uname -r |
Tips for Running Linux Commands Safely
Before executing unfamiliar commands on a production server:
- Check your current directory and verify file paths.
- Back up configuration files before editing them.
- Use
sudoonly when elevated permissions are necessary. - Avoid copying destructive commands without understanding them.
- Review service configuration before restarting critical applications.
If you’re working on a production VPS, consider testing changes in a staging environment first.
Frequently Asked Questions
top, free, df, systemctl, journalctl, ss, and curl are especially useful for monitoring server resources and investigating common problems.
Many do, but some depend on installed packages or system components. For example, apt is used on Debian-based systems, while systemctl requires systemd.
Not for every command. Viewing basic system information usually works as a regular user, while managing services and accessing protected logs may require sudo.
Yes. These commands are useful on Linux VPS and dedicated servers, provided your account has the necessary permissions.
Conclusion
Learning Linux commands for server management helps you diagnose performance issues, manage services, inspect logs, and maintain your server more confidently.
Start with resource monitoring and log inspection, then gradually learn service administration, networking, and permissions. You don’t need to memorize every command—knowing which one to use is what matters.