Home » Notes » How to List All Services Using Systemctl

How to List All Services Using Systemctl

Systemd initialization system loads units only when it is necessary. So, only units added to the system autostart, those that are dependent on other units, or those that you start manually, are in memory. If you want to get a full list of services which are present in your system, you shouldn't use the list-units command because it can print only units from the memory. Use the list-unit-files command instead. For example:

sudo systemctl list-unit-files --type service

Here you can see three columns with information:

  • UNIT FILE - service file name.
  • STATE - reflects whether the service is added to the system autostart. Available values: enabled (added), disabled (not added), and static (added and can't be removed).
  • VENDOR PRESET - reflects whether the service should be added to the autostart by default.

By default, this command will print its output using the less utility. So you can use the arrow keys on your keyboard to scroll the output up/down and right/left. If you want to disable pagination, use the --no-pager option:

sudo systemctl list-unit-files --type service --no-pager

Furthermore, you can use filtering by pattern if you want to find the services which contain specific symbols in their names. For example, those whose names begin with the word mysql:

sudo systemctl list-unit-files --type service 'mysql*'

As you can see, everything pretty straighforward. You can find more information about services in Linux in the Using Systemd Services Tutorial article.

Rate the Article

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
Creative Commons License
The article is distributed under Creative Commons ShareAlike 4.0 license. Link to the source is required .

Leave a Comment