≡ Menu

Red Hat / CentOS: Check / List Running Services

How do I list all currently running services in Fedora / RHEL / CentOS Linux server?

There are various ways and tools to find and list all running services under Fedora / RHEL / CentOS Linux systems.

service command – list running services

The syntax is as follows for CentOS/RHEL 6.x and older (pre systemd):
service --status-all
service --status-all | more
service --status-all | grep ntpd
service --status-all | less

Print the status of any service

To print the status of apache (httpd) service:
service httpd status

List all known services (configured via SysV)

chkconfig --list

List service and their open ports

netstat -tulpn

Turn on / off service

ntsysv
chkconfig service off
chkconfig service on
chkconfig httpd off
chkconfig ntpd on

ntsysv is a simple interface for configuring runlevel services which are also configurable through chkconfig. By default, it configures the current runlevel. Just type ntsysv and select service you want to run.

A note about RHEL/CentOS 7.x with systemd

If you are using systemd based distro such as Fedora Linux v22/23/24 or RHEL/CentOS Linux 7.x+. Try the following command to list running services using the systemctl command. It control the systemd system and service manager.

To list systemd services on CentOS/RHEL 7.x+ use

The syntax is:
systemctl
systemctl | more
systemctl | grep httpd
systemctl list-units --type service
systemctl list-units --type mount

To list all services:
systemctl list-unit-files
Sample outputs:

Fig.01: List all units installed on the CentOS /RHEL 7 systemd based system, along with their current states

Fig.01: List all units installed on the CentOS /RHEL 7 systemd based system, along with their current states


To view processes associated with a particular service (cgroup), you can use the systemd-cgtop command. Like the top command, systemd-cgtop lists running processes based on their service:
systemd-cgtop
Sample outputs:

Path                                            Tasks   %CPU   Memory  Input/s Output/s
 
/                                                  85    0.3   240.1M        -        -
/system.slice/NetworkManager.service                2      -        -        -        -
/system.slice/auditd.service                        1      -        -        -        -
/system.slice/crond.service                         1      -        -        -        -
/system.slice/dbus.service                          1      -        -        -        -
/system.slice/lvm2-lvmetad.service                  1      -        -        -        -
/system.slice/polkit.service                        1      -        -        -        -
/system.slice/postfix.service                       3      -        -        -        -
/system.slice/rsyslog.service                       1      -        -        -        -
/system.slice/sshd.service                          1      -        -        -        -
/system.slice/...tty.slice/getty@tty1.service       1      -        -        -        -
/system.slice/systemd-journald.service              1      -        -        -        -
/system.slice/systemd-logind.service                1      -        -        -        -
/system.slice/systemd-udevd.service                 1      -        -        -        -
/system.slice/tuned.service                         1      -        -        -        -
/system.slice/wpa_supplicant.service                1      -        -        -        -
/user.slice/user-0.slice/session-2.scope            1      -        -        -        -
/user.slice/user-1000.slice/session-1.scope         4      -        -        -        -

To list SysV services only on CentOS/RHEL 7.x+ use (does not include native systemd services)

chkconfig --list
Sample outputs:

Fig.02: List Sysv based services on systemd

Fig.02: List Sysv based services on systemd

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:



{ 21 comments… add one }
  • sankar January 22, 2009, 7:43 am

    it is help to view port status and services

  • Diabolic Preacher January 23, 2009, 3:58 pm

    would these work on a ubuntu-server install? i would really have some use for commands to list running services.

  • nixCraft January 23, 2009, 8:56 pm

    Yes, it should work – if you have sysvconfig package installed.

  • Diabolic Preacher January 24, 2009, 2:50 am

    thanks vivek, am hoping its already installed coz on a server you definitely wanna check on services.
    but isn’t it like ubuntu doesn’t follow the SysV model, especially in terms of the init system but has its own upstart something?

  • anderson July 1, 2009, 5:44 pm

    service httpd mysqld tomcat5 start/stop/restart/status
    chkconfig service on/off
    netstat -tulpn
    ntsysv gui
    service service start is different from chkconfig , when the server is rebooted , service start will not work .

  • Scott July 5, 2009, 10:41 pm

    In debian/ubuntu, install sysv-rc-conf and sysvinit-utils. That’s the first thing I do on any .deb box. These should be default with debian and ubuntu installs, IMO.

  • dragmore January 5, 2010, 12:54 pm

    I would love an article discribing all the “default” services in a Centos 5.x installation and which to keep for performance and secrutiy and which to turn off. Basically discribing the more common ones.
    When i list with ntsysv i see a ton i have no clue what really does ;)

  • thiyagi December 23, 2010, 11:42 am

    thanks, that was really useful..

  • chanvoeu February 9, 2011, 8:16 am

    Dear sir!
    Right now i have some question about Centos.
    i can not configure some main service dns, apache …
    please you help me!!!

  • toto March 7, 2011, 7:52 am

    nice information. thank you

  • chapise November 24, 2011, 1:30 am

    :D thank you so much dude,

  • t April 8, 2013, 11:19 am

    netstat -tulpn

  • garb May 23, 2013, 7:27 am

    For Ubuntu 12.04, you can list service status with 2 commands (first for SysV services and second for upstart services):

    service –status-all
    initctl list

  • deepak April 16, 2014, 2:45 pm

    hi guys please help me out,
    i have to run “.jar” as service in centos32 machine.
    how can i do that…

  • javeria turk May 22, 2014, 7:38 am

    what services of linux support virtualization?

  • Pauline February 9, 2015, 9:53 am

    Hi all,
    I need help on what command should I use to start/stop running services.
    Thanks

  • kalyan July 30, 2015, 11:22 am

    Hello Sir,
    i am using RHEL server 5.8 . Now i want to know the list of Services running as per OS level..
    I have executed “service –status-all ” -> it showing Error :bash :: command service not found..
    what ‘s the problem in my case ??
    my info ::: uname -a
    o/p :: Linux NEURAREPO 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
    pls guide me to know the lsit of Services running in my server.thnak you..

  • imran October 21, 2015, 6:51 am

    it very helpful for me thnx dear

  • Jhonattan March 16, 2016, 3:21 am

    Show all run java service.
    command: pidof java

  • Wouter Bovelander June 1, 2016, 9:06 am

    On CentOS7 I had to run

    systemctl

    To list all active services. Service –status-all no longer gives the desired result since systemd handles the init scripts.

  • James December 12, 2016, 2:25 pm

    I am using RHEL to host Bitbucket/Stash and would like to find out what account is using the service. How can I figure this out other than checking init.d script?

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , , , , , , , , ,