How to list services in Linux using the command-line

Performing basic functions in the command-line can be challenging if you're used to the GUI-based workflow of Windows or Linux desktops. A particular hurdle is working out how to get a list of running services when you cannot lean on hotkeys such as Ctrl + Shift + Esc or Ctrl + Alt + Del.

Listing services in Linux is a key part of server management. It allows you to check whether necessary services are running correctly or whether something is running that shouldn't. Fortunately, there are several ways to list services in Linux, though the commands can vary depending on the distribution. In this blog, we'll cover listing services on the most popular ones: Ubuntu, Debian, CentOS, and Fedora.

How to use systemctl to list services

systemctl is the recommended way to list services in Linux. It shows more information than other commands and outputs in a tabular format, which makes it easier to read. It also works on all of the Linux distributions mentioned above, with the same syntax.

List all services with systemctl

There are two main ways to list all services with systemctl.

When used with systemctl, the list-units option will list all active services. This includes all that are currently loaded, and are running, exited, or waiting. You can think of it as a way to see what's happening on your system in any given moment.

systemctl list-units --type=service

Appending the --all option to the end, meanwhile, shows all service units, including those that are not active, have failed, or were loaded in the past but aren't currently active. It gives you a complete view of all services known to systemd.

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

Filtering services with systemctl

Systemctl allows you to filter your output to services with specific states using the state option. We'll quickly cover each of the states below:

  1. List all running services in Linux using:
systemctl list-units --type=service --state=running

2. List all active services with:

systemctl list-units -a --state=active

3. List inactive service units with:

systemctl list-units -a --state=inactive

4. List failed services for troubleshooting using:

systemctl list-units --state=failed

5. Show services enabled on Linux boot:

systemctl list-unit-files --type=service --state=enabled

6. List every loaded service that is in the exited state:

sudo systemctl list-units --type=service --state=exited

You can combine these if you like. For example, you could get an overview of all active and failed services with systemctl list-units --type service --state=active, failed.

How to use service to list services in Linux


Another popular option for listing services in Linux is the service command, which should work on all distros that support System V init scripts.

service is a wrapper script for various init systems (init.d, upstart, systemd) rather than a direct interface and is therefore less powerful and comprehensible. It's usually recommended to use the direct interface to your init (like systemctlfor systemd distros), as they do everything service does and more.

The advantage of  service, however, is that it's very easy to remember and works across the various init systems mentioned above. If you want to list services without worrying about what the init is for a specific distro, service should work just fine.

How to list all Linux services with service

You can list all services with service with the following command:

service --status-all

You'll see a list of all services on your system with a symbol next to them. For example:

[ + ] apache2
[ - ] mysql
[ ? ] hwclock.sh

Here's what they mean:

Symbol Meaning
[ + ] Running
[ - ] Stopped
[ ? ] Status can't be determined

Filtering service output with grep

You can use the symbols above to filter to services that are running, or stopped.

For example, we can pipe the output to grep to filter to only services with the + symbol in front of them. This way, we can display only running services:

service --status-all | grep '\[ + \]'

To look for only services that aren't running, switch the + to a -:

service --status-all | grep '\[ - \]'

You can find the status of a particular service by typing service {service name} status. For example, service ssh status will return:

 ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/usr/lib/systemd/system/ssh.service; disabled; preset: enabled)
     Active: active (running) since Sun 2025-10-26 10:16:50 UTC; 7min ago
TriggeredBy: ● ssh.socket
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 1315 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
   Main PID: 1317 (sshd)
      Tasks: 1 (limit: 1112)
     Memory: 3.2M (peak: 4.6M)
        CPU: 175ms
     CGroup: /system.slice/ssh.service
             └─1317 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Let's break down the output:

  • Loaded: Indicates whether the service configuration is loaded and where it is located. In this case, it's loaded but disabled, meaning it won't start on boot.
  • TriggeredBy: Shows what triggers the service to start, in this case, the activation of the SSH socket.
  • Docs: Points to relevant manual pages, in this case man sshd and man sshd_config.
  • Process: What happened on service start (in this case, it ran a pre-start check to ensure the config was valid).
  • Main PID: The process ID of the main SSH daemon. This is the process that waits for incoming SSH connections.
  • Tasks: How many processes or threads are running under the service.
  • Memory/CPU: The system resources the service is using now and at its peak.
  • CGroup: The control group the service belongs to. This is what systemd uses to manage and track the process and its resources.

Counting services with grep -c

Last but not least, you can use grep to count your services, including the number that are running and not running. The commands are similar to above, but use the -c option to count the services rather than print the list.

You can count all services with:

service --status-all | grep -c ''


Services that are running using:

service --status-all | grep -c '\[ + \]'

And, finally, services that are not running:

service --status-all | grep -c '\[ - \]'

This can be a useful way to determine whether you have an too many  services or check whether new services have been added.