To list the services on a Linux server that uses systemd (Ubuntu, Debian, Fedora, RHEL, Arch and most others), run systemctl list-units --type=service --state=running. It prints every service that is running now, with its state and a short description. Other options of the same command list the services that start at boot, the ones that failed, and every service installed.
We ran each command below on 2 December 2026 on a small Ubuntu 26.04.1 LTS server with systemd 259: nginx, OpenSSH, cron, unattended-upgrades, and a backup service that copies a folder to a backup disk with rsync. The disk was not mounted, so the backup failed at boot. Every screenshot comes from that server.
Quick answer: systemctl commands to list services
| What you want | Command | On our server |
|---|---|---|
| Services running now | systemctl list-units --type=service --state=running | 6 |
| Running, exited and failed services | systemctl list-units --type=service | 19 |
| Every loaded service, inactive ones too | systemctl list-units --type=service --all | 87 |
| Every installed service file | systemctl list-unit-files --type=service | 153 |
| Services that start at boot | systemctl list-unit-files --type=service --state=enabled | 8 |
| Failed services | systemctl --failed | 1 |
| One service in detail | systemctl status nginx |
Listing needs no root. Add --no-pager if you do not want the list to open in a pager, and --no-legend to drop the header and the count at the end.
List running services with systemctl
systemctl list-units --type=service --state=running
Each line is one unit: UNIT is the service's name, LOAD says whether systemd read its unit file, ACTIVE is the general state (active, inactive, failed) and SUB the detailed one (running, exited, dead, failed). --state=running keeps the lines whose SUB state is running: the six services our server runs, from nginx to the journal. The last line gives the count.
A running service is not always one you installed: dbus, systemd-journald and systemd-logind are part of the system itself. On a full Ubuntu server install the list is longer (networking, time sync, snapd), but it reads the same way.
List all services: active, inactive and installed
Without --state, systemctl lists the services that are active or failed:
systemctl list-units --type=service
The list grows from 6 to 19. The services marked exited ran once at boot and finished: they did their job and are still counted as active. The failed backup shows in red with a dot. The last lines say that --all shows the inactive services too, and that systemctl list-unit-files shows every installed one. We counted each list:
systemctl list-units --type=service --state=running --no-legend | wc -l
systemctl list-units --type=service --no-legend | wc -l
systemctl list-units --type=service --all --no-legend | wc -l
systemctl list-unit-files --type=service --no-legend | wc -l
| Command | Services | What it counts |
|---|---|---|
--state=running | 6 | Running now |
| default (no option) | 19 | Active (running or exited) and failed |
--all | 87 | Every unit systemd has in memory, inactive and not-found ones too |
list-unit-files | 153 | Every service file on disk, loaded or not, with its enabled state |
list-units shows what systemd has loaded; list-unit-files shows what is installed. A service that was never started and that nothing depends on is only in the second list.
List enabled services (the ones that start at boot)
Enabled means "starts at boot", which is not the same as running now. list-unit-files gives the enabled state:
systemctl list-unit-files --type=service --state=enabled
systemctl is-enabled ssh.service ssh.socket
systemctl is-active ssh.service ssh.socket
Eight services are enabled on our server. PRESET is the state the distribution chose for each one. The list holds backup.service, which is enabled but failed, and [email protected], a template that starts login prompts on consoles. A running service can also be missing from it: dbus.service and systemd-journald.service run because other units need them, not because they are enabled.
SSH is the usual surprise on Ubuntu: ssh.service is disabled and inactive, yet SSH logins work. ssh.socket is enabled and active: systemd itself waits for SSH connections and starts the SSH server when one comes in (socket activation). So check the socket too before you decide SSH is off.
List failed services and find out why
systemctl --failed
systemctl is-system-running
sudo systemctl status backup.service
systemctl --failed lists only the units that failed; here, the backup. One failed unit is enough for systemctl is-system-running to answer degraded instead of running, which makes that command a simple check for monitoring scripts.
systemctl status gives the reason. Active: failed (Result: exit-code) means the program exited with an error; the Process line shows the command and its exit status (11). The log lines below it say what happened: rsync could not create /mnt/backup/data because /mnt/backup did not exist, as the backup disk was not mounted. Without sudo, the status showed our user no log lines: reading the system log needs root (or the adm or systemd-journal group). The hint at the end says to add -l for lines cut at the screen's width.
Fix the cause, then start the service again
On our server the backup needed its target folder. We created it and started the service:
sudo mkdir -p /mnt/backup
sudo systemctl start backup.service
systemctl --failed
systemctl is-system-running
The backup ran, no failed service was left, and the system was running again. A one-time service such as this backup is inactive (dead) after a successful run, so it does not appear in the running list: that is normal for a job that ends.
Clear the failed state without a fix
To clear an old failure you already know about, use reset-failed. We removed the folder again, so the backup failed on start, then cleared it:
sudo systemctl start backup.service
systemctl --failed --no-legend
sudo systemctl reset-failed backup.service
systemctl --failed --no-legend
systemctl is-system-running
The failure is gone from the list and the system says running, but nothing was fixed: the next start fails again. Use it after a fix, or for a service you removed.
Check one service with systemctl status
systemctl status nginx
systemctl is-active nginx
The status of one service gives its unit file and whether it is enabled (Loaded), its state and the time it started (Active), its main process, the number of tasks, its memory use and the processes in its control group (nginx: one master and eight workers). In a script, systemctl is-active nginx prints one word and returns exit code 0 only when the service is active; systemctl is-enabled prints the boot state the same way.
Service names only, for scripts
systemctl list-units --type=service --state=running --no-legend --plain | cut -d " " -f 1
--no-legend removes the header and the count, --plain removes the dot that systemctl puts in front of a failed unit, and cut keeps the first column. The output is one service name a line, ready for a loop or a monitoring check. For a long-running watch of a server's services, Beszel shows them with alerts.
service --status-all: the old command
service --status-all comes from before systemd, and many answers still give it:
service --status-all
It lists only the services that ship an old init script in /etc/init.d: [ + ] running, [ - ] stopped. The backup service, which has only a systemd unit, is missing, and ssh shows [ - ] though SSH logins work through the socket. On a systemd server, use systemctl.
Frequently asked questions
How do I list all services in Linux?
On a systemd distribution, systemctl list-units --type=service --all lists every service systemd has loaded, and systemctl list-unit-files --type=service every service file installed. On our Ubuntu 26.04.1 server that was 87 and 153.
How do I list only running services?
systemctl list-units --type=service --state=running. Add --no-legend --plain and cut -d " " -f 1 for the names only.
What is the difference between list-units and list-unit-files?
list-units shows the units systemd has loaded, with their current state. list-unit-files shows the files installed on disk, with their enabled state, whether they run or not.
Why is a service enabled but not running?
Enabled only means it starts at boot. It may have failed (our backup), finished its job (a one-time service), or be stopped by hand. systemctl status with the service's name says which.
Why is ssh.service disabled on Ubuntu?
Ubuntu starts SSH through ssh.socket: systemd waits for connections and starts the SSH server on the first one. On our server ssh.socket was enabled and active while ssh.service was disabled and inactive.
What does "degraded" mean?
systemctl is-system-running answers degraded when at least one unit failed. systemctl --failed lists them; after a fix or a reset-failed it answers running.
How do I clear a failed service?
Fix the cause and start the service again, or run sudo systemctl reset-failed with the service's name to clear the failed state without a fix.
Related guides
- How to start netbackup services in linux
- CrowdSec vs Fail2ban: Tested on Ubuntu 26.04
- nginx2root (CVE-2026-123007): Find and Patch Every nginx
- Beszel with Docker Compose: Server Monitoring and Alerts
- USN-8924-1: What Ubuntu Admins Need to Do
- Install Docker Compose on Ubuntu using Docker’s repository
Sources
Leave a comment
Your email address will not be published. Required fields are marked *
