How to list systemd services using systemctl

Listing systemd services shows which daemons and helper units the service manager currently knows about, which ones are running now, and which ones are merely installed on disk. That quick inventory is useful after a package install, during boot troubleshooting, before editing dependencies, or when confirming the exact service name to inspect next.

The systemctl client exposes two complementary views. systemctl list-units –type=service asks the running manager for service units currently loaded in memory and reports their LOAD, ACTIVE, and SUB states. systemctl list-unit-files –type=service instead reads installed unit files and shows their enablement state, so the two commands answer different questions and often return different counts.

By default, list-units shows services that are active, failed, or have queued jobs, while --all expands the view to loaded but inactive services as well. That still does not equal every installed service on the system, so use list-unit-files when you need the broader inventory. Unit names can also vary by distribution, such as ssh.service versus sshd.service, and per-user services live under systemctl --user rather than the system manager.

Steps to list systemd services using systemctl:

  1. Open a terminal session on the Linux host that runs systemd.
  2. List the service units that the running manager currently has in memory.
    $ systemctl list-units --type=service --no-pager
      UNIT                                     LOAD   ACTIVE SUB     DESCRIPTION
      dbus.service                             loaded active running D-Bus System Message Bus
      getty@tty1.service                       loaded active running Getty on tty1
      ldconfig.service                         loaded active exited  Rebuild Dynamic Linker Cache
      systemd-binfmt.service                   loaded active exited  Set Up Additional Binary Formats
      systemd-journal-catalog-update.service   loaded active exited  Rebuild Journal Catalog
      systemd-journal-flush.service            loaded active exited  Flush Journal to Persistent Storage
      systemd-journald.service                 loaded active running Journal Service
      systemd-logind.service                   loaded active running User Login Management
      systemd-modules-load.service             loaded active exited  Load Kernel Modules
      systemd-remount-fs.service               loaded active exited  Remount Root and Kernel File Systems
    ##### snipped #####
    19 loaded units listed. Pass --all to see loaded but inactive units, too.
    To show all installed unit files use 'systemctl list-unit-files'.

    The default view is not a full on-disk inventory. Upstream systemctl documents list-units as the in-memory view, so inactive services that are not currently loaded do not appear here.

  3. Limit the output to services that are running right now when you only need the active daemons.
    $ systemctl list-units --type=service --state=running --no-pager --no-legend
    dbus.service             loaded active running D-Bus System Message Bus
    getty@tty1.service       loaded active running Getty on tty1
    systemd-journald.service loaded active running Journal Service
    systemd-logind.service   loaded active running User Login Management
    systemd-resolved.service loaded active running Network Name Resolution

    Add --no-legend when the output is being copied into notes or fed to another command and you do not need the column legend.

  4. Add --all when you also need loaded services that are currently inactive.
    $ systemctl list-units --type=service --all --no-pager
      UNIT                      LOAD      ACTIVE   SUB     DESCRIPTION
      apt-daily-upgrade.service loaded    inactive dead    Daily apt upgrade and clean activities
      apt-daily.service         loaded    inactive dead    Daily apt download activities
    ● auditd.service            not-found inactive dead    auditd.service
      dbus.service              loaded    active   running D-Bus System Message Bus
      getty@tty1.service        loaded    active   running Getty on tty1
      ssh.service               loaded    inactive dead    OpenBSD Secure Shell server
    ##### snipped #####

    --all expands the in-memory view, but it still does not replace list-unit-files. Entries marked not-found usually indicate an alias or dependency that was referenced even though the backing unit file is not installed.

  5. Filter the current service inventory by unit name or state when the list is too broad.
    $ systemctl list-units --type=service 'systemd-*' --state=running --no-pager --no-legend
    systemd-journald.service loaded active running Journal Service
    systemd-logind.service   loaded active running User Login Management
    systemd-resolved.service loaded active running Network Name Resolution

    Quote glob patterns so the shell passes them to systemctl unchanged. Upstream also notes that list-units does not show uninstantiated templates such as foo@.service.

  6. List installed service unit files when you need the broader service inventory together with enablement state.
    $ systemctl list-unit-files --type=service --no-pager
    UNIT FILE                                    STATE           PRESET
    apt-daily-upgrade.service                    static          -
    apt-daily.service                            static          -
    autovt@.service                              alias           -
    console-getty.service                        enabled-runtime disabled
    dbus.service                                 static          -
    e2scrub_reap.service                         enabled         enabled
    getty@.service                               enabled         enabled
    networkd-dispatcher.service                  enabled         enabled
    serial-getty@.service                        disabled        enabled
    ssh.service                                  disabled        enabled
    ##### snipped #####

    The STATE column shows the current installation state such as enabled, enabled-runtime, disabled, static, masked, or alias. PRESET shows the vendor preset policy, which may differ from the current state.

  7. Narrow the installed list by pattern when the exact unit name is not yet certain.
    $ systemctl list-unit-files --type=service 'ssh*' --no-pager --no-legend
    ssh.service disabled enabled

    list-unit-files can find installed templates and inactive services that do not appear in list-units. For per-user service inventories, use systemctl --user list-unit-files --type=service against the logged-in user's manager instead of the system-wide manager.