How to check all services running in Linux

When using any Linux distribution, several processes and services will run together. Some services may run in the background without the user's knowledge. Running unnecessary services can consume a lot of system resources or cause security problems.

Therefore, it is necessary to know all the services that are running on the system. In this article, TipsMake.com will show you all possible ways to list the services running on Linux computers.

How to check the services running in Linux

First, understand the Linux services. If the service has a script, then it comes with three states:

  1. start (start)
  2. stop
  3. restart

This is all done with the - service command . For example, to restart service network-manager, run the following command:

sudo service network-manager restart

The service command references each service using the init script stored in /etc/init.d for Ubuntu and any other Debian-based distributions, and etc / rc.d / init.d for the distributions. Linux distribution is based on RedHat. Some service names vary by distribution. For example, the Apache web server service is httpd on CentOS and Apache2 on Ubuntu.

Many Linux distributions belong to the following init systems:

  1. System V (SysV) , is the original init system.
  2. Upstart
  3. systemd , is the newest init system as of the time of writing.

Check all services running in the System V (SysV) init system

Let's take a look at some of the Terminal commands you can use to list all services running on the SysV init system.

service --status-all
How to check all services running in Linux Picture 1 Service -status-all command output

The above command lists all the services running in the system. In case the service is running a lot, you can use the additional parameters - more and less to list the services in the view in an organized and clear manner.

service --status-all | less
How to check all services running in Linux Picture 2 Service command output –status-all | Less
service --status-all | more
How to check all services running in Linux Picture 3 Service command output –status-all | More

To list only services currently running on the system, execute the command below:

service --status-all | grep running

To view the status of a specific service, execute the command below:

service --status-all | grep [service_name] e.g service --status-all | grep httpd

Alternatively, you can execute the below command to view the status of a specific service.

service httpd status

To list all services that are activated during boot, execute the command below:

chkconfig --list

Check all services running in the Upstart init system

To list all services on Linux machines running the Upstart init system, execute the command below:

initctl list

Check all the services running in the Systemd init system

To list all services on Linux machines running Systemd init, execute the following command:

systemctl
How to check all services running in Linux Picture 4 Systemctl command output

From the above command, we see that the data is displayed in 5 columns, namely UNIT, LOAD, ACTIVE, SUB and DESCRIPTION .

You can also list running services based on their type with the following command:

systemctl list-units --type service
How to check all services running in Linux Picture 5 Output command systemctl list-units –type

You can also list services based on their current state. The result is quite similar to the output of the previous command but a bit simpler.

systemctl list-unit-files --type service
How to check all services running in Linux Picture 6 systemctl list-unit-files | grep enabled

To list the status of a specific service, execute the command below:

systemctl status [service_name] e.g systemctl status acpid.path
How to check all services running in Linux Picture 7 Systemctl status acpid.path command

To list only services currently running on the system, execute the command below:

systemctl | grep running
How to check all services running in Linux Picture 8 The systemctl command | grep running

To list all services that are activated during boot, execute the command below:

systemctl list-unit-files | grep enabled
How to check all services running in Linux Picture 9 The command systemctl list-unit-files | grep enabled

You can also view the top control groups and their use of system resources such as I / O, CPU, Tasks and Memory using the systemd-cgtop command .

systemd-cgtop
How to check all services running in Linux Picture 10 Systemd-cgtop command output

It is also possible to use pstree to list all services running on the system. Pstree gets this information from the Systemd system output.

pstree
How to check all services running in Linux Picture 11 Pstree command output

Pstree can also be used with the System V int system. It takes the output from the SysVinit system.

pstree

You can also use the chkservice utility to check all the services running on the Systemd system. This utility is not preinstalled. However, you can install it via Terminal using the command below:

sudo apt-get install chkservice
How to check all services running in Linux Picture 12 Chkservice installation command

To start the chkservice, execute the command below. Note, you need superuser rights.

sudo chkservice
How to check all services running in Linux Picture 13 The command starts chkservice

To see all the features that come with this great tool, press the key ?to open the Help menu .

How to check all services running in Linux Picture 14 Press ? to open the Help menu
4 ★ | 2 Vote

May be interested

  • How to install and optimize Minecraft on LinuxPhoto of How to install and optimize Minecraft on Linux
    minecraft usually runs well, but lower specification systems may occasionally experience performance issues. whether you have a top gaming pc or an old laptop, these minecraft optimization tips will help the game run smoother.
  • How to secure Linux server with fail2banPhoto of How to secure Linux server with fail2ban
    with fail2ban, your linux computer will automatically block ip addresses with too many connection errors. it is a secure way. the following article will show you how to use them.
  • Configure mouse settings on the Debian systemPhoto of Configure mouse settings on the Debian system
    debian allows you to create as many configurations as possible in the system modules. in this article, tipsmake.com will describe how to configure mouse settings on a debian system.
  • Differences between RHEL, CentOS and FedoraPhoto of Differences between RHEL, CentOS and Fedora
    linux distributions are very similar to car models. there are so many options, new options appear every day and it's hard to tell the difference between them. the following article will highlight the differences between rhel, centos and fedora.
  • How to install the latest LibreOffice version on CentOS 8Photo of How to install the latest LibreOffice version on CentOS 8
    libreoffice is a powerful and open source office suite. in this article, you will learn how to install libreoffice on centos 8. at the time of writing this article, the latest version of libreoffice 6.4.3 is available for installation.
  • How to use Lutris to play Blu-Ray on LinuxPhoto of How to use Lutris to play Blu-Ray on Linux
    now, users can play blu-ray discs on linux systems only by using windows software via wine. however, this process can cause many headaches and that's where lutris plays its role.