how we can see all running services Linux machine?
Asked Answered
C

2

27

I have a Linux [ Ubuntu Version 16.04 or Upper version ] machine and I want to see how many services are running right now and how many services are installed using 1 command or the minimum commands of use. How can I see this?

Carpi answered 22/2, 2021 at 11:29 Comment(0)
B
50

List services

service

The service --status-all command will list all services on your Ubuntu Server (both running services and not running services):

service --status-all

Using the grep command, we can filter the output to show only the running services:

service --status-all | grep '\[ + \]'

To list Ubuntu services that are not running, type:

service --status-all | grep '\[ - \]'

The service command can be used to list services in all Ubuntu releases, including Ubuntu 17, 16.04, and 14.04.

systemctl

To list all running services on Ubuntu, Type:

systemctl list-units

Count

running services

service --status-all | grep -c '\[ + \]'

not running services

service --status-all | grep -c '\[ - \]'

all services

service --status-all | grep -c ''
Byline answered 22/2, 2021 at 11:42 Comment(3)
Please click the Linux tag and read what it says.Battled
Dear arturwwl, Thank you for replay and help.Carpi
service --status-all doesn't return all the services I could find resolved service just with systemctl : sudo systemctl list-units --state running | grep 'resolved'Myrna
H
10

Although service is still working on ubuntu 22, it is recommended to use systemctl for list running services as follows:

sudo systemctl list-units --state running
Hans answered 19/9, 2023 at 12:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.