⚙️
systemd Cheat Sheet
Units, timers, journals, and service debugging on Linux.
Related: nginx · postgresql · redis · docker
Service control
| Command | Description | |
|---|---|---|
sudo systemctl start|stop|restart|reload <unit> | Control a unit | |
sudo systemctl enable --now <unit> | Enable and start on boot | |
sudo systemctl status <unit> | State + recent log lines | |
sudo systemctl is-active <unit> | Active check (exit code) |
Units & timers
| Command | Description | |
|---|---|---|
systemctl list-units --type=service --state=running | Running services | |
systemctl list-units --type=service --state=failed | Failed services | |
systemctl list-timers --all | Scheduled timers | |
sudo systemctl daemon-reload | Reload unit files after edit |
Logs
| Command | Description | |
|---|---|---|
sudo journalctl -u <unit> -f | Follow unit logs | |
sudo journalctl -u <unit> --since today | Today's logs | |
sudo journalctl -p err -b | Errors this boot | |
sudo journalctl -xe | Recent log with hints |