How to List Services with systemctl in Linux

Deepak Prasad
Tested on Red Hat Enterprise Linux 10.2 (lab VM)
Package systemd 257 (systemd-257-23.el10_2.2.x86_64)
Applies to RHEL, Rocky Linux, AlmaLinux, Fedora, Debian, Ubuntu, and other GNU/Linux systems with systemd
Privilege Normal user for read-only listing; root or sudo only when a command needs elevated access for unrelated tasks
Scope List loaded and installed service units with list-units and list-unit-files, filter by running, enabled, disabled, failed, and inactive states, check one unit with is-active and is-enabled, and trim output for scripts — not start, stop, restart, or enable
Related guides systemctl command
Beginner's guide to systemd
View logs with journalctl
systemd timers
Linux commands cheat sheet

systemctl is the read-only listing layer for systemd services: which units are loaded in memory right now, which unit files are installed on disk, and whether each one is running, enabled, or failed. This page covers only those list and query commands. For start, stop, restart, enable, status, and daemon-reload, use the systemctl command cheat sheet.


Quick reference: systemctl service listing commands

Task Command
Loaded service units (default filtered view) systemctl list-units --type=service
All loaded service units systemctl list-units --type=service --all
Installed service unit files systemctl list-unit-files --type=service
Running services only systemctl list-units --type=service --state=running
Enabled systemctl list-unit-files --type=service --state=enabled
Disabled unit files systemctl list-unit-files --type=service --state=disabled
Failed services systemctl list-units --type=service --state=failed
Failed shortcut systemctl --failed
One unit: running? systemctl is-active sshd
One unit: enabled? systemctl is-enabled sshd
Script-friendly output add --no-legend --no-pager

Always add --type=service when you mean daemons. Without it, list-units also shows sockets, mounts, targets, and other unit types.


1. List all running and loaded services

systemctl list-units shows units currently loaded in systemd's memory — not every unit file on disk. By default it lists active units, units with pending jobs, and failed units. Add --all to include inactive loaded units too.

Restrict the list to service units:

bash
systemctl list-units --type=service

The table has four columns that matter for day-to-day checks:

  • LOAD — whether the unit definition was loaded (loaded, not-found, masked, …)
  • ACTIVE — high-level activation (active, inactive, failed, …)
  • SUB — fine-grained state (running, dead, exited, …)
  • DESCRIPTION — text from the unit file
output
UNIT                                     LOAD   ACTIVE SUB     DESCRIPTION
  accounts-daemon.service                  loaded active running Accounts Service
  alsa-state.service                       loaded active running Manage Sound Card State (restore and store)
  atd.service                              loaded active running Deferred execution scheduler
  auditd.service                           loaded active running Security Audit Logging Service
  avahi-daemon.service                     loaded active running Avahi mDNS/DNS-SD Stack
  chronyd.service                          loaded active running NTP client/server
  colord.service                           loaded active running Manage, Install and Generate Color Profiles

On this lab host the command ends with a line such as 38 loaded units listed — that count is loaded service units matching the default filter, not every service on the system.

To include inactive loaded units (for example dead services that systemd has already parsed), add --all:

bash
systemctl list-units --type=service --all

That widens the ACTIVE column to inactive and dead units while still showing only what is loaded in memory, not every file under /usr/lib/systemd/system.


2. List all installed service unit files

Installed unit files and their enablement state live in a separate view. systemctl list-unit-files walks unit files on disk and reports whether each one is enabled, disabled, static, masked, and so on.

bash
systemctl list-unit-files --type=service
output
UNIT FILE                                             STATE           PRESET
accounts-daemon.service                               enabled         enabled
alsa-card-wait@.service                               static          -
alsa-restore.service                                  static          -
alsa-state.service                                    static          -
arp-ethers.service                                    disabled        disabled
atd.service                                           enabled         enabled
audit-rules.service                                   enabled         enabled

The footer on this host reports 329 unit files listed — far more than the list-units count because it includes service unit files available to systemd, including those not loaded right now.

NOTE
list-unit-files answers "is this unit file installed and what is its enablement?" list-units answers "what is loaded and what state is it in now?" Use the matching command for the question you are asking.

3. List running services only

Runtime state filters apply to list-units, not list-unit-files. To print only services whose active state is running:

bash
systemctl list-units --type=service --state=running
output
UNIT                       LOAD   ACTIVE SUB     DESCRIPTION
  accounts-daemon.service    loaded active running Accounts Service
  alsa-state.service         loaded active running Manage Sound Card State (restore and store)
  atd.service                loaded active running Deferred execution scheduler
  auditd.service             loaded active running Security Audit Logging Service
  avahi-daemon.service       loaded active running Avahi mDNS/DNS-SD Stack

Here the footer shows 38 loaded units listed on the lab VM — every row is active with SUB=running. That is the usual filter when you want a snapshot of live daemons, not unit files waiting on boot policy.


4. List enabled and disabled services

Enablement is a property of the unit file on disk. Use list-unit-files with --state=:

bash
systemctl list-unit-files --type=service --state=enabled
output
UNIT FILE                          STATE   PRESET
accounts-daemon.service            enabled enabled
atd.service                        enabled enabled
audit-rules.service                enabled enabled
auditd.service                     enabled enabled
avahi-daemon.service               enabled enabled

The lab host lists 52 unit files in the enabled set. STATE is enablement; PRESET reflects distribution policy from systemd-preset when the package was installed.

Disabled unit files:

bash
systemctl list-unit-files --type=service --state=disabled
output
UNIT FILE                                             STATE    PRESET
arp-ethers.service                                    disabled disabled
autofs.service                                        disabled disabled
blk-availability.service                              disabled disabled
brltty.service                                        disabled disabled
canberra-system-bootup.service                        disabled disabled

Combine states in one query with a comma-separated list:

bash
systemctl list-unit-files --type=service --state=enabled,disabled

That returns 124 unit files listed here — enabled and disabled rows only, excluding static and other states.


5. List failed and inactive services

Failed units are a runtime state. List them with list-units:

bash
systemctl list-units --type=service --state=failed
output
UNIT                               LOAD   ACTIVE SUB    DESCRIPTION
● NetworkManager-wait-online.service loaded failed failed Network Manager Wait Online

1 loaded units listed.

The bullet () marks a unit that needs attention. The same list appears from the shortcut:

bash
systemctl --failed

Inactive loaded services — parsed but not running (often inactive (dead)):

bash
systemctl list-units --type=service --state=inactive
output
UNIT                                   LOAD      ACTIVE   SUB  DESCRIPTION
  alsa-restore.service                   loaded    inactive dead Save/Restore Sound Card State
  audit-rules.service                    loaded    inactive dead Load Audit Rules
  auth-rpcgss-module.service             loaded    inactive dead Kernel Module supporting RPCSEC_GSS
● auto-cpufreq.service                   not-found inactive dead auto-cpufreq.service
  autofs.service                         loaded    inactive dead Automounts filesystems on demand

inactive is normal for oneshot or on-demand units between runs. failed means the last start attempt did not succeed — check journalctl -u unitname after you identify the unit here.


6. list-units vs list-unit-files

Both commands accept --type=service, but they answer different questions:

Question Command Typical columns
What is loaded in memory right now? list-units LOAD, ACTIVE, SUB
What unit files are installed? list-unit-files STATE (enablement), PRESET
Is it running? list-units --state=running ACTIVE, SUB
Is the unit enabled? list-unit-files --state=enabled STATE
Did a start fail? list-units --state=failed or --failed ACTIVE=failed

--state= values differ between the two subcommands. Run systemctl --state=help when you need the full vocabulary — load states such as masked, active states such as activating, and file states such as static and indirect.


7. Check one service: active, enabled, or failed

Listing every unit is noisy when you care about one daemon. is-active and is-enabled return a single word suitable for scripts and exit codes.

Check whether sshd is running:

bash
systemctl is-active sshd
output
active

Check whether the unit is enabled:

bash
systemctl is-enabled sshd
output
enabled

A unit can be enabled but inactive if nothing has started it yet, or active while static if another unit pulls it in. Compare both checks when troubleshooting.

For a missing unit name, is-active prints inactive or unknown and is-enabled may print not-found — as with postfix on this lab host where no unit file is installed:

bash
systemctl is-active postfix
output
inactive

Enablement on a missing unit uses a different keyword:

bash
systemctl is-enabled postfix
output
not-found

systemctl status sshd still shows the full picture (loaded, active, PID, recent log lines). This article stays on list-style queries; see the systemctl command cheat sheet for status and lifecycle actions.


8. Filter and script systemctl service output

Add a unit name pattern to narrow either list command:

bash
systemctl list-units --type=service 'sshd*'

The same glob syntax applies to installed unit files when you are hunting package units such as PostgreSQL:

bash
systemctl list-unit-files --type=service 'postgresql*'

Patterns follow systemd unit glob rules — the same style as systemctl status postgresql*.

For scripts, --no-legend --no-pager skips the column header, footer legend, and pager:

bash
systemctl list-units --type=service --state=running --no-legend --no-pager

Pipe through awk to collect unit names only:

bash
systemctl list-units --type=service --state=running --no-legend --no-pager | awk '{print $1}'
output
accounts-daemon.service
alsa-state.service
atd.service
auditd.service
avahi-daemon.service

The same pattern works on list-unit-files when you need enabled names:

bash
systemctl list-unit-files --type=service --state=enabled --no-legend --no-pager | awk '{print $1}'
output
accounts-daemon.service
atd.service
audit-rules.service
auditd.service
avahi-daemon.service

Combine is-active / is-enabled in shell conditionals when you only need a pass-or-fail check for one unit.


Summary

Use systemctl list-units --type=service when you need loaded units and runtime state — running, inactive, or failed. Use systemctl list-unit-files --type=service when you need installed unit files and enablement — enabled, disabled, or static. The search phrases "list all services" and "list running services" map to those two commands with different --state= filters, not to one interchangeable invocation.

Keep the distinction in scripts: is-enabled reads disk policy; is-active reads the current process state. When a full table is too wide, add a name pattern, --no-legend --no-pager, and awk or grep to trim columns. For everything beyond listing — starting a daemon, enabling a unit, or reading a long status block — continue with the systemctl command cheat sheet and journalctl when failed units need log context.


References


Frequently Asked Questions

1. What is the difference between systemctl list-units and list-unit-files?

list-units shows units currently loaded in memory with runtime states such as active, inactive, or failed. list-unit-files lists unit files known to systemd and their enablement state such as enabled, disabled, or static. Use list-units for what is loaded now; list-unit-files for installed unit files and enablement.

2. How do I list only running services with systemctl?

Run systemctl list-units --type=service --state=running. That prints loaded service units whose active state is running. Add --no-legend --no-pager for easier script processing without column headers, footer legend, or a pager.

3. How do I check if a systemd service is enabled?

Run systemctl is-enabled unitname for one service, or systemctl list-unit-files --type=service --state=enabled for the full enabled list. Enablement comes from list-unit-files, not from list-units.

4. How do I list failed systemd services?

Run systemctl list-units --type=service --state=failed or the shortcut systemctl --failed. Both show units whose active state is failed. Fix the unit, then systemctl reset-failed clears the failed marker after the problem is resolved.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on OpenStack, KVM, Proxmox, and VMware.

  • Debian
  • Ubuntu
  • Linux
  • Red Hat Enterprise Linux
  • Shell Script
  • System Administration