How to check all the running services in Linux

When using Linux, many processes and services run in the background, some with your knowledge and some may be malicious and run without your permission. In this post, we look at all the best ways to list the services running on the Linux system.

When using any Linux distribution, some processes and services run alongside. Some can be running in the background even without users’ knowledge. Having unnecessary services running can consume much of the system resources or also pose a security issue if measures are not put into consideration.

Therefore, there comes a need to know all the running services on your system. In this article, we look at all the possible ways which you can use to list running services on your Linux machine.

How to check running services in Linux

Let us first get a good understanding of Linux services. If a service has an initialization – script, then it comes with three statuses:

  • start
  • stop
  • restart

All which are executed with the – service command. For example, to restart the network-manager service, 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 distro, and etc/rc.d/init.d for RedHat-based Linux distributions. Some service name varies from one distribution to another. For example, the Apache webserver service is httpd on CentOS and Apache2 on Ubuntu.

System V(SysV) | Upstart | Systemd

A lot of Linux distros fall under of the following init systems:

  • System V, which was the initial init system.
  • Upstart
  • systemd, which is the latest init system as of writing this article.

System V (SysV)

System V or commonly known as SysV is an old init system used by older Linux distributions and dates back to the original Unix. SysV manages the startup process using shell script present in the /etc/init*. In case you are using /etc/init.d/sshd start to start or stop a service; then you are using on a System V system.

Upstart Init System

It is an event-based init system which served as a replacement for the /sbin/init daemon. Upstart init system was used to manage the start and stopping of services during boot, shutdown, and supervising them while the system is running. Upstart was initially developed for Ubuntu Linux distro to replace the old System V used in other older distributions.

Systemd

It is the new init system that most Linux distros are moving to. It was developed to speed up the boot process, managing dependencies, and much more. In case you are using systemctl restart sshd start to start or stop a service, then you are using on a Systemd system.

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

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

service --status-all

service --status-all command output
service –status-all command output

The above command lists all the running services in your system. In case the services running are many, you can use additional parameters – more and less to list the services in an organized and clear view.

service --status-all | less

service --status-all | Less command output
service –status-all | Less command output

service --status-all | more

service --status-all | More command ouput
service –status-all | More command output

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

service --status-all | grep running

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

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

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

service httpd status

To list all the services enabled in the boot, execute the command below:

chkconfig --list

Check all running services in an Upstart init system

To list all services running on a Linux system running Upstartinit system, execute the command below:

initctl list

Check all running services in a Systemd init system

To list all running services on a Linux system running Systemd init system, execute the command below:

systemctl

systemctl command output
systemctl command output

From the above command, we see that the data is displayed in five columns, namely, UNIT, LOAD, ACTIVE, SUB, and DESCRIPTION. Let’s look at what each column stands for:

  • UNIT – Shows the corresponding Systemd unit name.
  • LOAD – This column displays whether the current unit is loaded on memory or not.
  • ACTIVE – This column indicates whether the unit is in use (active) or not.
  • SUB – Describes the running state of a particular unit.
  • DESCRIPTION – Gives a detailed description of a particular unit.

You can also list running services based on their type using the command below:

systemctl list-units --type service

systemctl list-units --type service
systemctl list-units –type service

You can also list services based on their current state. It is relatively similar to the output of the previous command but a little more straightforward.

systemctl list-unit-files --type service

systemctl list-unit-files | grep enabled
systemctl list-unit-files | grep enabled

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

systemctl status [service_name]
e.g
systemctl status acpid.path

systemctl status acpid.path
systemctl status acpid.path

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

systemctl | grep running

systemctl | grep running command
systemctl | grep running command

To list all services enabled in the boot, execute the command below:

systemctl list-unit-files | grep enabled

systemctl list-unit-files | grep enabled command
systemctl list-unit-files | grep enabled command

You can also view top control groups and their system resource usage such as I/O, CPU, Tasks, and memory using the systemd-cgtop command.

systemd-cgtop

systemd-cgtop command output
systemd-cgtop command output

We can also use pstree to list all running services in the system. Pstree captures this information from Systemd system output.

pstree

pstree command output
pstree command output

The pstree can also be used with System V int system. It captures output from the SysVinit system.

pstree

You can also use chkservice utility to check all running services in a Systemd system. It does not come pre-installed. However, you can install via Terminal using the command below:

sudo apt-get install chkservice

Install chkservice command
Install chkservice command

To start chkservice, execute the command below. Note, you require superuser privileges.

sudo chkservice

start chkservice Terminal command
start chkservice Terminal command

To see all the features that come with this fantastic tool, press the [?] key. It opens the help menu.

Press ? to view help menu - chkservice
Press ? to view help menu – chkservice

Conclusion

These are some of the commands and utilities you can use to check all running services on your Linux system. If you have a command or tool that we have not discussed in this post, feel free to let our readers know in the comment section.

Arun Kumar
Arun did his bachelor in computer engineering and loves enjoying his spare time writing for FOSS Linux. He uses Fedora as the daily driver and loves tinkering with interesting distros on VirtualBox. He works during the day and reads anything tech at night. Apart from blogging, he loves swimming and playing tennis.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,648FansLike
360FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

How to install CMake on Ubuntu

CMake is a cross-platform free and open-source software tool designed to build, test, and package the software. CMake uses a simple platform and compiler-independent configuration files to control the software compilation process.

How to install Lightworks on Ubuntu

Even though Linux may not get a native installer of video editing software like Adobe Premiere or Final Cut Pro, that doesn't mean there are no industry standards tools available. Lightworks is non-linear editing (NLE) video mastering app for Windows, Linux, and macOS. Installing it on Ubuntu is simple due to deb package availability.

How to install DaVinci Resolve on Fedora

Davinci Resolve is a professional application used for color correction, video editing, visual effects, and motion graphics. It is one of the extensively used software by movie industries located in Hollywood.

The 10 Best Programming Languages for Hacking

One of the significant entities we have in Cyber Security is Ethical Hacking (ETH). It is the process of detecting and finding flaws or vulnerabilities in a system that a hacker would exploit.

5 Ways to Open a Terminal in Ubuntu

Even though Ubuntu supports many applications with amazing Graphical User Interfaces (GUI), there are always reasons why users prefer using the Terminal to perform different tasks.

How to install Wine on Fedora Workstation

Linux distributions are becoming more and more popular every day, and Fedora Workstation is not left behind. This popularity brings forth the need to run Windows applications on Linux distros like Fedora. Windows has quite some excellent Software that is not available for Linux.

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

Test drive a Linux distro online before you hate it

Enter DistroTest.net, a website that allows Linux users to test various distros online, without downloading the ISO or installing the distro. With DistroTest.net, you can check a distro with no muss, no fuss.

Ubuntu MATE 20.04 LTS Review: Refinement at its Best

Ubuntu MATE 20.04 LTS was released a week ago after two years of development. Official updates and security patches will be provided until April 2025. I have installed it on my test laptop for a spin and here are my observations based on almost a week usage.

What’s New in Ubuntu 20.04 LTS “Focal Fossa”

Ubuntu 20.04 LTS is out now! This is the successor to Ubuntu 18.04, which was released in April 2018 and still has three years of official support left. Code-named Focal Fossa, the new edition has all the bells and whistles included in it, making it one of the best Ubuntu releases yet. Let's find out more.

6 Essential Command-Line Utilities Every Linux User Should Know

Last week, we shared with you several "cool and fun" commands to get comfortable and confident with the Linux command-line. In our quest to further aid Linux users with mastery of the command line, or CLI, we present you with a variety of command-line utilities essential for all Linux users, regardless of proficiency level.