Skip to main content

systemctl Cheatsheet

By Dejan Panovski Updated on Download PDF

Quick reference for systemctl service and systemd unit management

systemctl is the systemd command-line tool for managing services and other units. This cheatsheet covers common service actions, unit inspection, and system-wide controls.

Service Control

Start, stop, and restart services.

CommandDescription
systemctl start nginxStart a service
systemctl stop nginxStop a service
systemctl restart nginxRestart a service
systemctl reload nginxReload configuration without full restart
systemctl try-restart nginxRestart only if running
systemctl reload-or-restart nginxReload or restart if reload unsupported

Enable at Boot

Control whether a service starts automatically.

CommandDescription
systemctl enable nginxEnable at boot
systemctl disable nginxDisable at boot
systemctl enable --now nginxEnable and start immediately
systemctl disable --now nginxDisable and stop immediately
systemctl is-enabled nginxCheck if enabled

Status and State

Check service state and details.

CommandDescription
systemctl status nginxShow status and recent logs
systemctl is-active nginxCheck if active
systemctl is-failed nginxCheck if failed
systemctl show nginxShow unit properties
systemctl show -p ExecStart nginxShow a specific property

List Units

Find units and see what is running.

CommandDescription
systemctl list-unitsList active units
systemctl list-units --type=serviceList active services
systemctl list-units --allList all units
systemctl list-unit-filesList unit files and enablement
systemctl list-unit-files --type=serviceList service unit files

Unit Files

Inspect and edit unit files.

CommandDescription
systemctl cat nginxShow unit file content
systemctl edit nginxCreate override drop-in
systemctl edit --full nginxEdit full unit file
systemctl daemon-reloadReload systemd units after changes

Masking and Dependencies

Prevent services from starting or inspect dependencies.

CommandDescription
systemctl mask nginxPrevent a unit from starting
systemctl unmask nginxRemove mask
systemctl list-dependencies nginxShow dependencies
systemctl list-dependencies --reverse nginxShow reverse dependencies

System Actions

System-wide power and state controls.

CommandDescription
systemctl rebootReboot the system
systemctl poweroffPower off the system
systemctl haltHalt the system
systemctl suspendSuspend
systemctl hibernateHibernate