• Start Here
    • How to Install Linux
    • Which Distro To Choose
    • 10 Best Linux Distributions of 2023
  • Distros
    • Ubuntu
  • Linux Commands
  • Virtualization
  • Open Source
Linux Start
  • Start Here
    • How to Install Linux
    • Which Distro To Choose
    • 10 Best Linux Distributions of 2023
  • Distros
    • Ubuntu
  • Linux Commands
  • Virtualization
  • Open Source
Linux Start
Home»Distros»Ubuntu»How To List Services On Ubuntu

How To List Services On Ubuntu

Anup ThapaBy Anup ThapaApril 7, 2023 Ubuntu 2 Mins Read

Ubuntu uses the systemd service manager, which acts as an init system. It runs as the first process on startup (PID 1) and is responsible for starting and maintaining other services.

systemd uses a dependency system called ‘units’. Service units specifically, are responsible for managing daemons and the processes that they’re made of.

systemd is managed using the systemctl utility. We’ll explain how you can use systemctl and service units to list various services in this article.

List Services with systemctl

The list-units or -l options list units that systemd currently has in memory. The same behavior is assumed seen if you run systemctl without any options. This will list units that are active, have pending jobs, or have failed. Also, specify the unit type as service to only list services.

systemctl list-units --type=service

Here’s how you can interpret the output:

  • UNIT: The systemd unit name
  • LOAD: Defines whether the unit’s config has been loaded by systemd
  • ACTIVE: High-level unit activation state (basically a summary)
  • SUB: Low-level unit activation state (more details)
  • DESCRIPTION: Unit description

List All systemd Services 

If you pass the --all option, that’ll show all services that were loaded at boot, regardless of their current state.

systemctl list-units --type service --all

Ultimately, the list-units command only displays units that systemd has tried to load. Certain units that systemd doesn’t think necessary won’t be included in this list as they haven’t been loaded. To see every available unit file, use the following command instead:

systemctl list-unit-files

In niche cases, you might even need to list systemd services on a system that’s not online. In such cases, you can specify the root directory like so

systemctl --root=/path/to/root list-unit-files

List Services by Startup Order

By default, systemctl lists services in alphabetical order. If you want to sort them in the order they were loaded instead, you can use the systemd-analyze tool. 

You can redirect the output to a text file like so

systemd-analyze dump > SystemdDump.txt

Or, if you prefer a graphical format, you could use

systemd-analyze plot > SystemdPlot.svg

List Services by Status

A service’s activation state can be active, inactive, activating, deactivating, failed, not-found, or dead. This is a common way to filter the output and find certain types of services.

systemctl list-units --state=failed
Anup Thapa
  • LinkedIn

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. At LinuxStart, Anup is an integral part of our editorial team. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys experimenting with different Linux distros and reading up on things like networking and virtualization.

Leave A Reply Cancel Reply

Table of Contents
  • List Services with systemctl
  • List All systemd Services 
  • List Services by Startup Order
  • List Services by Status
Linux Start
Guides

What is the Linux Kernel?

The Linux Kernel is the core of the Linux operating system and is central to…

How To Install Linux Mint

How To Install Linux on VirtualBox

Getting Started with Linux

How to Install Linux

10 Best Linux Distros of 2023

Which Linux Distro Should You Choose? A Complete Guide to Help You Decide

© 2023 LinuxStart.com

Type above and press Enter to search. Press Esc to cancel.