Many processes run as services managed by systemd on your Ubuntu 22.04 system. In this tutorial, you will learn how to list and change state for systemd services and unit files on Ubuntu 22.04 Jammy Jellyfish Linux Server/Desktop.
In this tutorial you will learn:
- How to list services and unit files
- How to list running/exited/dead services
- How to list enabled/disabled services

Category | Requirements, Conventions or Software Version Used |
---|---|
System | Ubuntu 22.04 Jammy Jellyfish |
Software | systemd (installed by default) |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Ubuntu 22.04 list services by examples
-
List all services
To list all services unit files execute the bellow command from your terminal:
$ systemctl list-units --all --type=service --no-pager
-
List all available systemd unit files
-
List all active running/exited/dead services
The
systemctl
command can be used to list all active running services:$ systemctl list-units --all --type=service --no-pager | grep running
To display all exited service execute:
$ systemctl list-units --all --type=service --no-pager | grep exited
Furthermore, to show all stopped/dead systemd services execute:
$ systemctl list-units --all --type=service --no-pager | grep dead
You can start and stop services using the
systemctl
command. For example to start Apache2 service we can execute:$ systemctl start apache2
Conversely, to stop service execute:
$ systemctl stop apache2
-
List enabled/disabled systemd service unit file states
The following
systemctl
command will list all enabled services on Ubuntu 22.04 Desktop/Server.$ systemctl list-unit-files | grep enabled
On the other hand to list all disabled services execute:
$ systemctl list-unit-files | grep disabled
Enabled services will automatically start after system reboot.
Use the
systemctl
command to set the service state as enabled or disabled. For example the following command will enable the Apache2 service to start during the system boot startup:$ sudo systemctl enable apache2
Or to disable the service from starting after the system reboot execute:
$ sudo systemctl disable apache2
The following command will display all available systemd unit files regardless of their state and type:
$ systemctl list-unit-files --no-pager
Use the grep
command in case you are searching for a specific unit file. For example the bellow command will search for an apache2
unit file:
$ systemctl list-unit-files --no-pager | grep apache2
Closing Thoughts
In this tutorial, you saw how to list systemd services on Ubuntu 22.04 Jammy Jellyfish Linux. Since most processes are managed by systemd, knowing how to list and manage these services is an essential part of system administration. You now know how to start, stop, enable, disable, and list services, among other commands, on Ubuntu 22.04.