List Running Services
systemctl list-units --type=service --state=running
Each line is one service, with five columns:
| Column | Meaning |
|---|---|
| UNIT | The service name, such as nginx.service. |
| LOAD | Whether systemd read the unit file. |
| ACTIVE | The general state: active, inactive, or failed. |
| SUB | The detailed state, such as running or exited. |
| DESCRIPTION | A short description. |
Add --no-pager to print the list without the scrolling viewer, which is useful in scripts and when you pipe the output to grep.
All Loaded Services
systemctl list-units --type=service
systemctl list-units --type=service --all
Without --all, systemctl shows only the services that are active, failed, or waiting for a pending job. With it, inactive ones appear too. Services that exited after doing their work, such as one-time setup tasks, show active and exited; that is normal.
List Failed Services
systemctl --failed
systemctl list-units --type=service --state=failed
The first command lists failed units of every type, such as mounts and timers; the second lists failed services only. For each failed service, read why it stopped:
systemctl status nginx
journalctl -u nginx -b --no-pager | tail -50
After you fix the cause and restart the service, it leaves the list. To clear an entry for a service you no longer need, run sudo systemctl reset-failed nginx. Run systemctl --failed after every reboot; the checklist is in how to reboot a Linux server.
All Installed Services and Boot Settings
systemctl list-unit-files --type=service
systemctl list-unit-files --type=service --state=enabled
This lists unit files on disk, whether they run or not. The STATE column tells you what happens at boot:
- enabled: starts at boot.
- disabled: does not start at boot, but can be started by hand.
- static: cannot be enabled on its own; another unit or a timer starts it.
- masked: blocked completely; it cannot be started until unmasked.
Check One Service
| Command | Answers |
|---|---|
systemctl is-active nginx | active or inactive |
systemctl is-enabled nginx | enabled or disabled |
systemctl is-failed nginx | failed or not |
systemctl status nginx | State, PID, memory, last log lines |
The is- commands also set an exit code, so a script can test them: systemctl is-active --quiet nginx || echo "nginx is down".
Filter the List
systemctl accepts a name pattern in quotes:
systemctl list-units 'php*'
systemctl list-units --type=service | grep -i mysql
Service names differ between distributions. SSH is ssh on Debian and Ubuntu and sshd on AlmaLinux and Rocky Linux; cron is cron or crond; Apache is apache2 or httpd. If a name is not found, list with a pattern first.
Start, Stop, and Enable
| Command | Effect |
|---|---|
sudo systemctl start nginx | Starts it now. |
sudo systemctl stop nginx | Stops it now. |
sudo systemctl restart nginx | Stops and starts it. |
sudo systemctl reload nginx | Rereads its configuration. |
sudo systemctl enable --now nginx | Starts it and at every boot. |
sudo systemctl disable nginx | Removes it from boot. |
Test a configuration before a restart, for example with sudo nginx -t, and be careful with the SSH service, as described in how to change the SSH port. Timers, systemd's scheduled jobs, are listed with systemctl list-timers; see how to list cron jobs. To write a service of your own, read systemd unit files explained.