How to List Running Services on Linux

Services are the backbone of any operating system and are essential to ensure the optimal functioning of various applications. It generally refers to the daemons or background processes that run independently without user involvement.

Users often need to view these services in various situations such as system monitoring, security audits, issue troubleshooting, service dependency analysis, etc. Moreover, knowing about these services can enable you to manage your system’s resources more effectively.

However, many Linux beginners always look for methods to display the currently running services. So, this short blog is all about the ways to list the running services on Linux without hassle.

How to List the Running Services on Linux

There are different ways in which you can list the running services on Linux. Therefore, this section is divided into various subsections to dive into those methods, each at a time.

1. Systemctl Command

The “systemctl” command can monitor and manage the systems including its services. However, its drawback is that it lists the services regardless of their state (running, terminated, or failed). Hence, to list the running services, you must use the following command:

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

In the given command, the “–type=service” and “–state=running” options, as they suggest, explicitly instruct the tool to list only the running services.

Note:

  1. It lists only a few lines at a time. After reaching the end, you can press “Enter” to continue viewing the list.
  2. After using the command, you can’t interact with the terminal. That’s why you must exit it by pressing “Q”.

Moreover, if you intend to list the services that are run by a specific program, use the “grep” command to filter the results.

sudo systemctl list-units –type=service –state=running | grep app_name

In this command, replace the “app_name” with the actual name of the application or program that you want to target. For example, let’s list the services that are run by the cron daemon:

sudo systemctl list-units –type=service –state=running | grep cron

2. Netstat Command

Netstat provides a detailed information about different services that are running on their associated ports.

This command lists the services and their corresponding port numbers and process IDs. The “-tulpn” option filters the result to show the TCP and UDP services.

Conclusion

Listing the running services in the system is essential for the administration. Therefore, this short blog includes simple methods to list the running services on your devices. We explained two ways that involve the use of “systemctl”, “grep”, and “netstat” commands. Moreover, these commands fully serve your purpose, so we did not list any other elusive methods.

source

Leave a Comment