Ubuntu

How to List Services in Ubuntu 22.04

There are different services that are running in the background of Ubuntu and consuming the RAM of the machine though they are not being used by the users. These services not only consume the battery of the machine but also affect the performance of the RAM as it is already busy with some other services.

In this blog, methods of listing down different types of services in Ubuntu have been explained.

How to List Services in Ubuntu

There is a “systemctl” utility that can be used to list down services on Ubuntu as well as to manage them by a stop or starting those services. The general syntax of using the systemctl command is:

$ systemctl [OPTIONS] <ACTION>

The explanation of the general syntax of using the systemctl command:

  • Use the systemctl command
  • Use any of systemctl options
  • Type the action you want to perform

We will understand its usage with some examples.

How to List All Services on Ubuntu

To list down all the services that are being run on Ubuntu, we will use the action of “–no-pager” without any options:

$ systemctl --no-pager

All the services are being displayed with their service status like in the above output, 261 loaded services are listed.

How to List down All the Unit Files on Ubuntu Jammy Jellyfish

The unit files are the text files containing information like start-up target, socket, device name, and a watched file system path. These unit files can be displayed on the screen by running the command:

$ systemctl list-units --all --type=service --no-pager

177 loaded files are listed down in the output of the above-executed command.

How to List Services State in Ubuntu 22.04

To list down only the states of the services, whether they are enabling or disabled, also if they are in other states, we will run the command:

$ systemctl list-unit-files --no-pager

In the above output, it can be seen that the status of every service has been displayed.

Conclusion

The systemctl utility, which is available by default in Ubuntu, can be used to list services in Ubuntu 22.04 using the command “systemctl –no-pager”. In this blog, different types of options have been used to list down the services on Ubuntu 22.04.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.