How to List All Running Services on Ubuntu


If you need to view a list of all the services that are either running or stopped (or both) on an Ubuntu server, then you can use the following command:

service --status-all

This will print out a list of services that may look something like this:

# service --status-all
 [ - ]  acpid
 [ + ]  apache-htcacheclean
 [ + ]  apache2
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  atd
 [ - ]  console-setup.sh
 [ + ]  cron
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ + ]  datadog-agent
 [ + ]  datadog-agent-process
 [ + ]  datadog-agent-trace
 [ + ]  dbus
 [ - ]  docker

Only show Running Services in Ubuntu

If you are only interested in the running services, then we can filter by the [ + ] items:

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

This will show the following:

# service --status-all | grep '\[ + \]'
 [ + ]  apache-htcacheclean
 [ + ]  apache2
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  atd
 [ + ]  cron
 [ + ]  datadog-agent
 [ + ]  datadog-agent-process
 [ + ]  datadog-agent-trace
 [ + ]  dbus
 [ + ]  ebtables

This prints out a reduced list of only the running services.

Only show Stopped Services in Ubuntu

The opposite is also true, we can also show a list of all stopped services:

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

This will show the following:

# service --status-all | grep '\[ - \]'
 [ - ]  acpid
 [ - ]  console-setup.sh
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ - ]  docker