Beginner · 7 min · practise every command in the built-in terminal

systemd & systemctl

systemd is the init system on most modern Linux distributions — it starts services at boot and manages them while the system runs. systemctl is the command you use to control it.

Check a service's status

systemctl status nginx
systemctl status sshd

Shows whether it's running, since when, recent log lines, and the process tree.

List running services

systemctl list-units --type=service
systemctl list-units --type=service --state=running

List all unit files (including disabled)

systemctl list-unit-files --type=service

Is a service enabled at boot?

systemctl is-enabled nginx
systemctl is-active nginx

Reading a status output

● nginx.service - A high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
   Active: active (running) since Mon 2024-01-15 09:00:00 UTC

● green = running, red = failed/stopped.

Practice tasks

  1. Check the status of the nginx service
  2. List all currently running services
  3. Check whether nginx is enabled to start at boot
  4. List all unit files, including disabled ones

Commands in this lesson

Services & systemd