systemctl Cheat Sheet

Manage systemd services, units, targets, and boot state from the command line.

Troubleshooting4 sections · 28 commands
⌘K

Units

6
systemctl list-units --type=service

All loaded service units

systemctl cat nginx

Show the unit definition and drop-ins

systemctl show nginx -p MainPID

Read one property of a unit

systemctl edit nginx

Edit a unit's drop-in override

systemctl daemon-reload

Reload unit files after edits

systemctl list-unit-files | grep enabled

Units enabled at boot

Service Control

12
systemctl start SERVICE

Start a service

systemctl stop SERVICE

Stop a service

systemctl restart SERVICE

Restart a service

systemctl reload SERVICE

Reload config without downtime

systemctl status SERVICE

Service state, PID, recent logs

systemctl is-active SERVICE

Print activate/failed/inactive

systemctl is-enabled SERVICE

Is it enabled at boot

systemctl enable SERVICE

Start at boot

systemctl disable SERVICE

Do not start at boot

systemctl enable --now SERVICE

Enable and start in one step

systemctl mask SERVICE

Block a service entirely

systemctl kill -s SIGKILL SERVICE

Send a raw signal to the unit

Boot & Targets

7
systemctl get-default

Current default target

systemctl set-default multi-user.target

Boot to text mode

systemctl isolate rescue.target

Switch to maintenance mode

systemctl reboot

Reboot the host

systemctl poweroff

Shut down the host

systemctl suspend

Suspend to RAM

systemctl list-sockets

Socket-activated units

Timers

3
systemctl list-timers

All timers and next runs

systemctl start fstrim.timer

Activate a timer now

systemctl list-timers --all

Include inactive timers