← All cheatsheets

Linux

systemd — manage Linux services

Manage Linux services with systemctl: start, stop and enable units, check status, read logs with journalctl, and reload edits.

Service control

sudo systemctl start name — start

sudo systemctl stop name — stop

sudo systemctl restart name — stop + start

sudo systemctl reload name — reload config without restart (if supported)

Boot behavior

sudo systemctl enable name — start on boot

sudo systemctl disable name — don't start on boot

sudo systemctl is-enabled name — check boot state

Status + diagnostics

systemctl status name — current state + recent log

systemctl list-units --type=service — all services

systemctl list-units --type=service --failed — failed only

systemctl cat name — show the unit file

Logs

journalctl -u name — all logs for this unit

journalctl -u name -f — follow (tail -f equivalent)

journalctl -u name --since "10 min ago" — recent slice

Reload + edit

sudo systemctl daemon-reload — reload after editing a unit file

sudo systemctl edit name — edit override file (recommended over editing /lib/systemd/system/)