Listing Linux Services with systemctl

In Linux, a service is a program that runs in the background . Services can be started on-demand or at boot time.
If you are using Linux as your primary operating system or development platform, you will deal with different services such as a web server, SSH, or cron . Knowing how to list running services or check the service status is important when debugging system issues.
Most recent Linux distributions use systemd as the default init system and service manager. Systemd is a suite of tools for managing Linux systems. It is used to boot up the machine, manage services, automount filesystems, log events, set up the hostname, and other system tasks.
This article explains how to use systemctl to list services, filter by state, and check service status.
Listing Services
Systemd uses the concept of units, which can be services, sockets, mount points, devices, etc. Units are defined using text files in ini format. These files include information about the unit, its settings, and commands to execute. The filename extension defines the unit file type. For example, system service unit files have a .service extension.
systemctl is a command-line utility used for controlling systemd and managing services. It is part of the systemd ecosystem and is available by default on most modern Linux distributions.
To get a list of all loaded service units, type:
sudo systemctl list-units --type serviceUNIT LOAD ACTIVE SUB DESCRIPTION
cron.service loaded active running Regular background program processing daemon
...Each line of output contains the following columns from left to right:
UNIT— The name of the service unit.LOAD— Whether the unit file has been loaded into memory.ACTIVE— The high-level activation state, which can be active, reloading, inactive, failed, activating, or deactivating. It is a generalization of theSUBcolumn.SUB— The low-level activation state. The value of this field depends on the unit type. For example, a service unit can be in one of the following states: dead, exited, failed, inactive, or running.DESCRIPTION— A short description of the unit.
By default, the command lists only the loaded active units. To see loaded but inactive units too, pass the --all option:
sudo systemctl list-units --type service --allFiltering by State
You can use the --state flag to filter services by their current state. This is useful when you want to see only running services or only those that have failed.
To list only running services:
systemctl list-units --type service --state=runningTo list only failed services:
systemctl list-units --type service --state=failedThere is also a shortcut for listing all failed units across the system:
systemctl --failedTo list exited services (services that ran once and completed):
systemctl list-units --type service --state=exitedListing Installed Unit Files
The list-unit-files command shows all installed unit files on disk, not just the currently loaded ones. This is useful for checking which services are enabled to start at boot:
systemctl list-unit-files --type serviceUNIT FILE STATE PRESET
cron.service enabled enabled
nginx.service enabled enabled
ssh.service enabled enabled
apparmor.service enabled enabled
apt-daily.service static -
...The STATE column shows the enable status of each service:
enabled— The service starts automatically at boot.disabled— The service does not start at boot.static— The service cannot be enabled directly. It is started only as a dependency of another unit.masked— The service is completely blocked from starting.
To list only the services that are enabled at boot, you can filter by state:
systemctl list-unit-files --type service --state=enabledDisplaying Service Status
To check the status of a service, use the systemctl status command. For example, to determine the current status of the nginx service you would run:
sudo systemctl status nginx.servicesystemctl status nginx is the same as systemctl status nginx.service.● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2026-03-03 19:13:50 UTC; 4 days ago
Docs: man:nginx(8)
Main PID: 3061064 (nginx)
Tasks: 2 (limit: 470)
Memory: 6.0M
CGroup: /system.slice/nginx.service
├─3061064 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─3061065 nginx: worker processThe command will print the following information:
Loaded— Whether the service unit has been loaded and the full path to the unit file. It also shows whether the unit is enabled to start at boot.Active— Whether the service is active and running. If your terminal supports colors and the service is active, the dot (●) and “active (running)” part will be printed in green. The line also shows how long the service has been running.Docs— The service documentation.Main PID— The process ID of the main service process.Tasks— The number of tasks accounted for the unit and the tasks limit.Memory— Information about used memory.CGroup— Information about related Control Groups.
Quick Status Checks
If you only want to check whether a service is running without the full status output, use the systemctl is-active command. For example, to verify that the nginx service is running, you would run:
systemctl is-active nginx.serviceactiveTo check whether a service is enabled to start at boot, use systemctl is-enabled:
systemctl is-enabled nginx.serviceenabledBoth commands return an exit status of 0 for true and non-zero for false, which makes them useful inside shell scripts:
if systemctl is-active --quiet nginx; then
echo "Nginx is running"
fiThe --quiet flag suppresses the text output so only the exit status is used.
Quick Reference
| Command | Description |
|---|---|
systemctl list-units --type service | List loaded active services |
systemctl list-units --type service --all | List all loaded services including inactive |
systemctl list-units --type service --state=running | List only running services |
systemctl --failed | List all failed units |
systemctl list-unit-files --type service | List all installed service unit files |
systemctl list-unit-files --state=enabled | List services enabled at boot |
systemctl status service_name | Show detailed service status |
systemctl is-active service_name | Check if a service is running |
systemctl is-enabled service_name | Check if a service starts at boot |
systemctl list-units --no-pager | List units without pager (useful for scripts) |
For a printable quick reference, see the systemctl cheatsheet .
Troubleshooting
Unit service_name.service could not be found
Check the exact unit name with systemctl list-unit-files --type service | grep name. Some services use different unit names than package names.
systemctl output is paged and hard to use in scripts
Add --no-pager to listing and status commands so output is printed directly to stdout.
Service shows failed but status output is too short
Use systemctl status service_name for recent errors, then run journalctl -u service_name for full logs.
You can list services but cannot manage them
Listing usually works without root privileges. Starting, stopping, enabling, and disabling services requires sudo or equivalent administrative permissions.
FAQ
What is the difference between list-units and list-unit-files?
list-units shows units that are currently loaded in memory. list-unit-files shows all installed unit files on disk, regardless of whether they are loaded. Use list-unit-files when you want to see which services are enabled or disabled at boot.
Do I need sudo to list services?
No. Most systemctl listing and status commands work without sudo. You only need elevated privileges to start, stop, enable, or disable services.
What does a “static” unit file state mean?
A static service cannot be enabled or disabled directly with systemctl enable. It is designed to be started only as a dependency of another unit or by manual invocation.
How do I find out why a service failed?
Run systemctl status service_name to see the last few log lines. For the full log output, use the journalctl -u service_name
command.
Conclusion
We have shown you how to use the systemctl command to list Linux services, filter them by state, and check their status. To view detailed logs for a service, use the journalctl
command.
Tags
Linuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
About the authors

Dejan Panovski
Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author page