Listing Linux Services With Systemctl

49

Listing Linux Services With Systemctl

A variety of services run continuously on a Linux background, such as network and system services. Services running on Linux are also known as daemons, which refers to a group of processes working on the back-end.

Services can be managed and listed through different methods and tools. The Systemd is a software suite of tools with the ability to manage Linux systems adopted by Linux distribution as a drop-in replacement of the init process.

All system tasks can be controlled through Systemd. The process can be started or ended using this tool, and all enabled and disabled services information can also be listed with Systemd.

List Services Using Systemctl in Linux

Systemctl is a utility with the responsibility to manage and control the systemd system. The systemctl command can be used to list all services in Linux.

We will now show you how systemctl works.

List All Services

To get a list of all the services on the system, whether they are loaded or inactive, issue the following systemctl command in the terminal:

$ systemctl list-units –type=service –all

All services in your system will appear on the screen, as you can see in the output shown in the image above.

List Loaded Services

The following command will list every loaded service that is running, active, or failed:

$ systemctl list-units –type=service

Listing Linux Services With Systemctl 1617266307 861 Listing Linux Services With Systemctl

Running Services

In many cases, it can be difficult to distinguish the running services from all the other services. Run the following command to obtain a quick response that shows the loaded and running services in the system:

$ systemctl list-units –type=service –state=running

Listing Linux Services With Systemctl 1617266308 593 Listing Linux Services With Systemctl

Enabled Services

Enter the following command to check the enabled services in the system:

$ systemctl list-unit-files –state=enabled

Listing Linux Services With Systemctl 1617266309 142 Listing Linux Services With Systemctl

Disabled Services

Disabled services will not start up or activate automatically. To enable a desired/required service, select the service from the disabled category. The following command is used to obtain a list of the disabled services in the system:

$ systemctl list-unit-files –state=disabled

Listing Linux Services With Systemctl 1617266309 626 Listing Linux Services With Systemctl

Check Service Status

The “cup” command is used to obtain more information about the status of a service. Cup is a modular printing system through which the computer acts as a print server and displays information. Use the cups command to obtain more information about the enabled/disabled services in the system:

$ systemctl status cups.service

Listing Linux Services With Systemctl 1617266310 121 Listing Linux Services With Systemctl

Conclusion

This article showed you how to use systemctl commands to list services in Linux, including multiple options for viewing the services. With the correct knowledge, it is easy to pick the required command.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More