| 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:
systemctl list-units --type=serviceThe 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
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 ProfilesOn 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:
systemctl list-units --type=service --allThat 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.
systemctl list-unit-files --type=serviceUNIT 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 enabledThe 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.
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:
systemctl list-units --type=service --state=runningUNIT 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 StackHere 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=:
systemctl list-unit-files --type=service --state=enabledUNIT 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 enabledThe 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:
systemctl list-unit-files --type=service --state=disabledUNIT 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 disabledCombine states in one query with a comma-separated list:
systemctl list-unit-files --type=service --state=enabled,disabledThat 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:
systemctl list-units --type=service --state=failedUNIT 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:
systemctl --failedInactive loaded services — parsed but not running (often inactive (dead)):
systemctl list-units --type=service --state=inactiveUNIT 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 demandinactive 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:
systemctl is-active sshdactiveCheck whether the unit is enabled:
systemctl is-enabled sshdenabledA 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:
systemctl is-active postfixinactiveEnablement on a missing unit uses a different keyword:
systemctl is-enabled postfixnot-foundsystemctl 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:
systemctl list-units --type=service 'sshd*'The same glob syntax applies to installed unit files when you are hunting package units such as PostgreSQL:
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:
systemctl list-units --type=service --state=running --no-legend --no-pagerPipe through awk to collect unit names only:
systemctl list-units --type=service --state=running --no-legend --no-pager | awk '{print $1}'accounts-daemon.service
alsa-state.service
atd.service
auditd.service
avahi-daemon.serviceThe same pattern works on list-unit-files when you need enabled names:
systemctl list-unit-files --type=service --state=enabled --no-legend --no-pager | awk '{print $1}'accounts-daemon.service
atd.service
audit-rules.service
auditd.service
avahi-daemon.serviceCombine 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.

