Skip to main content

Server Administration Cheat Sheet

Commands to keep your Linux servers running smoothly.

Systemd and Services

CommandDescription
systemctl status nginxCheck status of nginx.
systemctl start/stop nginxStart or stop the service.
systemctl enable nginxEnable service to start on boot.
systemctl reload nginxReload configuration without dropping connections.
journalctl -u nginxView logs for nginx.

Process Management

CommandDescription
top or htopInteractive process viewer.
ps auxList all running processes.
kill -15 1234Gracefully terminate PID 1234.
kill -9 1234Forcefully kill PID 1234.
nohup command &Run a command immune to hangups in the background.

Resource Monitoring

CommandDescription
free -hView RAM usage.
df -hView disk mount usage.
du -sh *View size of files/folders in current directory.
uptimeView how long the system has been running and load average.

Archives and Compression

# Create a tarball
tar -czvf archive.tar.gz /path/to/dir

# Extract a tarball
tar -xzvf archive.tar.gz