Categories: TutorialsUbuntu

Listing Services on Ubuntu 20.04

Introduction

If you are the system administrator, you can see all the services like process manager, login, syslog, … running in the background on your device.

These services help with how the system works and connects to other programs. And you can also list all these services on Ubuntu.

Now we’re gonna teach you to list all services by using the systemctl command on Ubuntu 20.04.

The syntax of the systemctl command

The syntax:

$ systemctl [options] [command]

To list all the services, run:

$ systemctl --no-pager

Output:

Listing
Sponsored
all unit files

Run the following command:

$ systemctl list-units --all --type=service --no-pager

Output:

Listing systemd unit files

Run:

$ systemctl list-unit-files --no-pager

Output:

Combining grep command to search for specific unit file

The syntax:

$ systemctl list-unit-files --no-pager | grep service_name

For example, I want to search for “session”:

$ systemctl list-unit-files --no-pager | grep session

Output:

Sponsored

Listing systemd service unit files by state

We will combine the grep command to do this. For example, I will list systemd service unit files are in the enabled state:

$ systemctl list-unit-files | grep enabled

Output:

For example, I will list systemd service unit files are in the disabled state:

$ systemctl list-unit-files | grep disabled

Output:

Listing services using pstree command

$ pstree

Output:

List the groups that use the most resources

Run the following command:

$ systemd-cgtop

Output:

Conclusion

We just taught you to list all services by using the systemctl command on Ubuntu 20.04.

Thank you for referring!

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Ubuntu Server Admin

Recent Posts

Canonical announces 12 year Kubernetes LTS

Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…

22 hours ago

Ubuntu Weekly Newsletter Issue 878

Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…

2 days ago

How your feedback shapes the way we support open source software

At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…

2 days ago

How To Install osTicket v1.14 On Ubuntu 20.04

I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…

3 days ago

How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…

3 days ago

How To Install DNS Server (Bind9) On Ubuntu 20.04

Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…

3 days ago