systemctl is the primary command-line client for interacting with systemd. It inspects, starts, stops, enables, disables, and reloads units, and queries their state. Every systemd user learns it by heart.
systemctl status sshd # show state and recent logs
systemctl start sshd
systemctl stop sshd
systemctl restart sshd
systemctl reload sshd # if the unit supports it
systemctl enable sshd # start at boot
systemctl disable sshd # don't start at boot
systemctl enable --now sshd # enable and start now
systemctl list-units --type=service # currently loaded services
systemctl list-unit-files --state=enabled
systemctl daemon-reload # reload after editing unit files
systemctl cat sshd # show the unit file
systemctl edit sshd # override file
systemctl edit --full sshd # edit the full unit
systemctl is-enabled sshd
systemctl isolate rescue.target # switch to rescue mode
sudo systemctl poweroff / reboot
Unit-file overrides created with systemctl edit live in /etc/systemd/system/<unit>.d/override.conf, letting you tweak a distribution-provided unit without editing the original. This is the recommended way to customise service behaviour, because the original file will be overwritten by the package manager on upgrade.
Related terms: systemd, systemd Unit, journalctl
Discussed in:
- Chapter 13: System Services and systemd — systemctl: The Main Interface
Also defined in: Textbook of Linux