Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Get the List of Services on Linux

October 27, 2022
in Blog, Linux
0
ADVERTISEMENT

Table of Contents

As a system administrator, you are probably dealing with a lot of services every day. On Linux, services are used for many different purposes.

In this post, you will learn how you to list all services on your Linux machine.

List Services using systemctl

The easiest way to list services on Linux, when you are on a systemd system, is to use the systemctl command followed by list-units. You can specify the option in order to restrict the results to services only.
systemctl list-units --type=service --all
[root@ct7 ~]# systemctl list-units --type=service --all
  UNIT                                                  LOAD      ACTIVE   SUB     DESCRIPTION
  auditd.service                                        loaded    active   running Security Auditing Service
  chronyd.service                                       loaded    active   running NTP client/server
● cloud-init-local.service                              not-found inactive dead    cloud-init-local.service
  cpupower.service                                      loaded    inactive dead    Configure CPU power related settings
  crond.service                                         loaded    active   running Command Scheduler
  dbus.service                                          loaded    active   running D-Bus System Message Bus
● display-manager.service                               not-found inactive dead    display-manager.service
  dm-event.service                                      loaded    inactive dead    Device-mapper event daemon
  dracut-cmdline.service                                loaded    inactive dead    dracut cmdline hook
  ...
  ...
  NetworkManager.service                                loaded    active   running Network Manager
● ntpd.service                                          not-found inactive dead    ntpd.service
● ntpdate.service                                       not-found inactive dead    ntpdate.service
  plymouth-quit-wait.service                            loaded    inactive dead    Wait for Plymouth Boot Screen to Quit
  plymouth-quit.service                                 loaded    inactive dead    Terminate Plymouth Boot Screen
  plymouth-read-write.service                           loaded    inactive dead    Tell Plymouth To Write Out Runtime Data
  plymouth-start.service                                loaded    inactive dead    Show Plymouth Boot Screen
lines 1-47

List Services by State

In some cases, you may only be interested in services that have failed. For that, you can specify the state that you are looking for as an option of the systemctl command.

###Services in single state
systemctl list-units --state=<state>

###Services in multiple states
systemctl list-units --state=<state1>,<state2>

Where the state can be one of the following values: active, inactive, activating, deactivating, failed, not-found or dead.

For example, if we are only interested in active services, we are going to run the following command:

systemctl list-units --state=active
# systemctl list-units --state=active
boot.mount                                loaded active mounted   /boot
dev-hugepages.mount                       loaded active mounted   Huge Pages File System
dev-mqueue.mount                          loaded active mounted   POSIX Message Queue File System
home.mount                                loaded active mounted   /home
run-user-0.mount                          loaded active mounted   /run/user/0
sys-fs-fuse-connections.mount             loaded active mounted   FUSE Control File System
sys-kernel-config.mount                   loaded active mounted   Configuration File System
sys-kernel-debug.mount                    loaded active mounted   Debug File System
session-1.scope                           loaded active running   Session 1 of user root
auditd.service                            loaded active running   Security Auditing Service
chronyd.service                           loaded active running   NTP client/server
crond.service                             loaded active running   Command Scheduler
dbus.service                              loaded active running   D-Bus System Message Bus
...

List All Service Files using list-unit-files

Finally, if you are interested in loaded, installed, disabled as well as enabled service files, there is another command that might be pretty handy.

# systemctl list-unit-files --type=service
UNIT FILE                                     STATE
auditd.service                                enabled
[email protected]                               enabled
blk-availability.service                      disabled
brandbot.service                              static
[email protected]                        static
chrony-wait.service                           disabled
chronyd.service                               enabled
console-getty.service                         disabled
console-shell.service                         disabled
[email protected]                      static
cpupower.service                              disabled
crond.service                                 enabled
dbus-org.fedoraproject.FirewallD1.service     enabled
dbus-org.freedesktop.hostname1.service        static
dbus-org.freedesktop.import1.service          static

Conclusion

In this tutorial, you learnt how you can easily list services on a Linux system.

5/5 - (1 vote)
Previous Post

How to Restart the Network Service on CentOS 8 or RHEL 8

Next Post

Script: How to Install LEMP Stack on CentOS 8/RHEL 8

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory