Skip to main content

Questions about systemctl - the main tool to interact with systemd and the service manager.

Ubuntu systems make use of systemd, which helps to start the system and services on the system. Hereby the systemctl command is the default tool for that issue.

The manual is hosted on and well documented, of course man systemctl works as well.

Before a short list of the most important commands are given some notes. Adding the flag -H user@host to your command allows you to control the systemd on a remote machine. If you do not know the exact name of a unit or command press the Tab key for auto-completion or use pattern matching as described in the bash man page.

In systemd units are the entities of systemd. The 11 different types for units are: service socket target device mount automount timer swap path slice scope. A detailed list and description can be found on systemd.special(7), systemd.service(5) and systemd(1).

systemctl                               # Prints a table of all units
systemctl list-units                    # List all units (where unit is the term for a job/service)
systemctl list-units --type target      # List all target units
systemctl status [PATTERN...|PID...]]   # Show runtime status followed by most recent log data
systemctl list-timers                   # List timer units currently in memory
systemctl list-unit-files --type masked # List all masked unit files

systemctl start [PATTERN...]            # Start (activate) one or more units
systemctl stop [PATTERN...]             # Stop (deactivate) one or more units
systemctl enable [PATTERN...]           # Enable one or more unit files
systemctl disable [PATTERN...]          # Disable one or more unit files
systemctl restart [PATTERN...]          # Restart one or more unit files

systemctl list-jobs [PATTERN...]        # List jobs
systemctl cancel [JOB...]               # Cancel all, one, or more jobs
systemctl reboot                        # Shut down and reboot the system
systemctl poweroff                      # Shut down the system

The complete list of commands is available on systemctl(1).