How to list Services on Ubuntu Linux
Listing services on Ubuntu Linux uses the `systemctl list-units –type=service` command.
Services are background programs that help your Ubuntu system run smoothly. They handle tasks like network connections and system updates. Modern Ubuntu versions, including Ubuntu 22.04 LTS, use `systemd` to manage these services.
Running `systemctl` shows you which services are running, stopped, or have had problems. This helps you figure out what’s happening on your computer.
You list services on Ubuntu Linux using the `systemctl list-units –all –type=service` command. This command displays all active and inactive services managed by systemd. For older Ubuntu versions, use the `service –status-all` command.
About systemctl command:
The systemctl command is your main tool for handling services on Ubuntu. It shows you which services are running, stopped, or set to start automatically when your computer boots up. This helps you understand what’s active and in control of your system’s background tasks.
Syntax:
The syntax is the rule and format of how the systemctl command can be used. These syntax options can be reordered, but a straight format must be followed.
Below is an example syntax of how to use the systemctl command.
systemctl [OPTIONS.] {COMMAND} .Options:
The command line options are switches or flags that determine how the commands are executed or controlled. They modify the behavior of the commands. They are separated by spaces and followed after the commands.
Below are some options for the systemctl command:
| COMMAND. | Replace COMMAND.. with the name of the command service names. |
| -t –type=TYPE, –state=STATE | Use the -t or –type or –state=STATE to list units of a particular type of service state: Active, Inactive |
| -a –all | Use the -a or –all to show all properties/all units currently in memory, including dead/empty ones. To list all units installed on the system, use the ‘list-unit-files’ command instead. |
| -r –recursive | Use the -r or –recursive to show a unit list of host and local containers |
| –help | Display a help message and exit. |
Examples:
Below are some examples of how to run and use the systemctl on Ubuntu Linux.
Simply run the systemctl command to invoke it.
Starting and Stopping Services
To start or stop services using the systemctl command, run the commands below:
sudo systemctl start application.service
To stop:
sudo systemctl stop application.service
Example:
sudo systemctl start application
Restarting and Reloading
You can restart or reload services on Ubuntu to apply changes or fix issues. Restarting completely stops and then restarts a service, while reloading applies new settings without stopping it. Use ‘sudo systemctl restart application.service’ to restart or ‘sudo systemctl reload application.service’ to reload.
sudo systemctl restart application.service
Or reload:
sudo systemctl reload application.service
Reloading a service only reloads configuration changes to a running service and won’t entirely restart the service. To fully restart a running service, you use the restart option.
Enabling and Disabling Services
You can choose whether a service starts automatically when your Ubuntu computer turns on or if it stays off. Enabling a service means it will start by itself the next time you boot up. Disabling prevents it from starting automatically, giving you control over which services run at startup.
sudo systemctl enable application.service
Or disable:
sudo systemctl disable application.service
Check service status
To check the status of a service, you use the status option.
sudo systemctl status application.service
Listing all services:
Listing all services on your Ubuntu system shows you exactly what’s running, stopped, or disabled. This command gives you a clear overview of every service’s status, helping you understand what’s active on your computer. Use ‘systemctl list-units –all –type=service –no-pager’ to see everything.
systemctl list-units --all --type=service --no-pager
That should list all services and output a similar screen as below:
UNIT LOAD ACTIVE SUB DESCRIPTION accounts-daemon.service loaded active running Accounts Service acpid.service loaded active running ACPI event daemon alsa-restore.service loaded active exited Save/Restore Sound Card State alsa-state.service loaded inactive dead Manage Sound Card State (restore and store) anacron.service loaded inactive dead ..
To list all inactive services, you run the commands below:
sudo systemctl list-units --all --state=inactiveFor only active services:
sudo systemctl list-units --all --state=inactiveWhen you run systemctl with the –help option, you’ll see the help text below:
systemctl [OPTIONS.] {COMMAND} .
Query or send control commands to the systemd manager.
-h --help Show this help
--version Show package version
--system Connect to system manager
--user Connect to user service manager
-H --host=[USER@]HOST
units installed on
.
Previous versions of Ubuntu using the service can use the commands below:
sudo service --status-all
That’s it!
Congratulations! You’ve learned how to use the systemctl to manage and list services on Ubuntu.
You may also like the commands below:
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!