System and processes
The systemctl command
Manages the system's services (units): start, stop, check whether they are active and decide whether they start with the machine.
Syntax
systemctl {status|start|stop|restart|enable|disable|is-active|is-enabled|list-units} UNIDADMost useful options
statusShows whether it is active, since when and its PIDstart / stopRuns or stops it right nowenable / disableDecides whether it starts at bootis-active / is-enabledAnswer active/inactive and enabled/disabledCopy-ready examples
$ systemctl status sshIs the ssh server active?$ sudo systemctl restart nginxRestart it after changing the config$ systemctl enable sshMake it start with the machine$ systemctl list-units --allEvery unitYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- start is now and enable is at boot: you can have an active but disabled service (or the opposite).
- Changing the state needs sudo.
- The short name works: ssh is ssh.service.
Related commands
FAQ
What is the difference from service?
systemctl is the modern system (systemd); service is the old way, still supported.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course