This blog has discussed methods to list different types of services in Ubuntu.
How to list services in Ubuntu
There is a “systemctl” utility that can be used to list services on Ubuntu and manage them by stopping or starting those services. The general syntax for using the systemctl command is:
The explanation of the general syntax for using the systemctl command:
- Use the systemctl command
- Use one of the systemctl options
- Enter the action you want to take
We will understand its usage with some examples.
How to list all services on Ubuntu
To list all services running on Ubuntu, we use the –no-pager action with no options:
All services are shown with their service status as in the output above, 261 loaded services are listed.
How to list all unit files on Ubuntu Jammy Jellyfish
The unit files are the text files that contain information like boot target, socket, device name and a monitored file system path. These unit files can be viewed on screen by running the following command:
177 loaded files are listed in the output of the command executed above.
How to list service status in Ubuntu 22.04
To only list the states of the services, whether they are enabled or disabled, even if they are in other states, we run the command:
In the output above, you can see that the status of each service has been displayed.
The systemctl utility available by default in Ubuntu can be used to list services in Ubuntu 22.04 with the “systemctl –no-pager” command. Different types of options were used in this blog to list the services on Ubuntu 22.04.