Cheat Sheet
The commands you keep forgetting, with a one-line description and a real example you can copy - 629 across 38 tools. Pick a tool in the sidebar, or search across all of them.
systemctl & journalctl
Manage Linux services and read their logs - the on-call survival pair.| Command | What it does | Example |
|---|---|---|
systemctl status | Is it running, since when, and the last log lines. | systemctl status nginx |
systemctl start / stop | Start or stop a service now. | sudo systemctl restart myapp |
systemctl enable | Start automatically at boot (--now also starts it). | sudo systemctl enable --now myapp |
systemctl disable | Remove from boot startup. | sudo systemctl disable myapp |
systemctl reload | Re-read config without dropping connections (if supported). | sudo systemctl reload nginx |
systemctl daemon-reload | Re-read unit files after editing one - easy to forget. | sudo systemctl daemon-reload |
systemctl list-units | What services exist and their states. | systemctl list-units --type=service --state=running |
systemctl is-active | Script-friendly running check. | systemctl is-active myapp |
systemctl cat | Show the unit file a service runs from. | systemctl cat myapp |
systemctl --failed | List every unit that failed to start. | systemctl --failed |
journalctl -u | All logs for one service. | journalctl -u myapp |
journalctl -u -f | Follow a service log live (like tail -f). | journalctl -u nginx -f |
journalctl --since | Logs from a time window. | journalctl -u myapp --since "1 hour ago" |
journalctl -p err | Only errors and worse, across everything. | journalctl -p err --since today |
journalctl -b | Logs since the current boot (-b -1 = previous boot). | journalctl -b -1 -u myapp |
journalctl -n | Just the last N lines. | journalctl -u myapp -n 100 |
journalctl --disk-usage | How much space logs are eating. | journalctl --disk-usage |
journalctl --vacuum-size | Trim old logs down to a size cap. | sudo journalctl --vacuum-size=500M |