Systemd Cheatsheet - Systemd Service Management Command Reference
Even if all you know is systemctl start or stop, it is worth walking through this set — it is the standard way to manage services on systemd distributions. Beyond start/stop and boot-enabling, it covers targeted journal log queries, timer scheduling, resource caps, and the control-group unit tree, answering three common questions: why a service fails to start, where to find its logs, and how to cap CPU or memory.
Service Management 8
systemctl start nginxStart the service into the running state; does not add it to boot-enable, so it goes away on reboot
systemctl stop nginxStop the running service, running its ExecStop before exit; does not touch whether it is enabled at boot
systemctl restart nginxStop then start again; drops active connections, so prefer reload when the process holds persistent sessions
systemctl reload nginxGracefully reload config without dropping connections; not all services support reload
systemctl enable nginxEnable the service to start at boot; add --now to also start it immediately
systemctl disable nginxDisable the service from starting at boot
systemctl enable --now nginxEnable at boot and start immediately
systemctl mask nginxFully disable a service so it cannot be started manually or pulled in by other units
Status 7
systemctl status nginxShow service state and recent logs (most common)
systemctl is-enabled nginxShow whether the service is enabled at boot
systemctl is-active nginxShow whether the service is currently running
systemctl is-failed nginxCheck whether the service is in a failed state
systemctl list-units --type=serviceList all loaded service units
systemctl list-unit-files --type=serviceList all installed service files and their boot-enable state
systemctl list-units --failedList failed services to troubleshoot startup errors
journalctl 8
journalctl -u nginxShow logs for the specified service
journalctl -u nginx -fFollow the service's logs in real time
journalctl --since "10 min ago" -u nginxShow logs from the last 10 minutes
journalctl --since today --until "1 hour ago"Filter logs by a time range
journalctl -p err -bShow logs at error level and above since boot
journalctl -u nginx -n 100 --no-pagerShow the last 100 log lines without paging
journalctl --disk-usageShow how much disk space journal logs use
journalctl --vacuum-size=100MVacuum logs, keeping only the most recent 100 MB
Targets & Runlevels 6
systemctl get-defaultShow the default boot target (equivalent to the runlevel)
systemctl set-default multi-user.targetSet the default to multi-user (command-line) mode
systemctl set-default graphical.targetSet the default to graphical desktop mode
systemctl isolate multi-user.targetSwitch to multi-user mode immediately (equivalent to init 3)
systemctl rescueEnter rescue mode (requires root; stops non-essential services)
systemctl list-units --type=targetList all currently active targets
Timers 6
systemctl list-timersList all scheduled timers (replaces crontab -l)
systemctl list-timers --allList all timers, including inactive ones
systemctl status <timer>Show a timer's state and next execution time
systemctl start <timer> && systemctl enable <timer>Enable a timer and start it at boot
systemctl cat <timer>Show the timer unit file contents
journalctl -u <timer>Show logs of the service triggered by the timer
Service Config & Resource Control 6
systemctl cat nginxShow the service's unit file contents
systemctl edit nginxEdit a service override config, stored in override.conf
systemctl edit --full nginxEdit the full unit file (not as an override)
systemctl daemon-reloadReload systemd configuration after editing unit files
systemctl set-property nginx CPUQuota=50%Limit the service to at most 50% CPU
systemctl set-property nginx MemoryMax=512MCap the service's memory at 512 MB
Troubleshooting & Analysis 6
systemctl --failedQuickly show all failed services
systemctl reset-failed nginxClear the failed state of a service
systemd-analyze timeShow total boot time
systemd-analyze blameList each service's startup time, sorted by duration
systemd-analyze critical-chain nginxShow the startup dependency chain for a service
systemctl daemon-reloadRequired after editing unit files, otherwise config won't take effect
Tips
- reload gracefully reloads config without dropping connections, while restart recreates the process. Not all services support reload — nginx does.
- journal logs rotate by default; if --disk-usage is too large, clean up with journalctl --vacuum-size=100M.
- Timers are more controllable than crontab: you can see execution logs in journalctl and they support dependency relationships.
- You must run systemctl daemon-reload after editing a unit file, otherwise systemd won't read the new config.
- systemctl edit creates an override.conf snippet that doesn't modify the original unit file — safer.
- mask is more thorough than disable: a masked service cannot be started manually or indirectly. Mask it before uninstalling a service.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us