Table of Contents
On a Linux system that uses systemd, run systemctl list-units --type=service --state=running to see services running right now. To see service definitions available to systemd, including disabled ones, use systemctl list-unit-files --type=service.
Choose the list that answers your question
| What you want to see | Command |
|---|---|
| Services with the running substate | systemctl list-units --type=service --state=running |
| Active services, including active one-shot services that have exited | systemctl list-units --type=service --state=active |
| Loaded service units, including inactive ones | systemctl list-units --type=service --all |
| Service unit files and their enablement states | systemctl list-unit-files --type=service |
| Failed services | systemctl list-units --type=service --state=failed |
Add --no-pager when you want the full list printed directly. To inspect services in your own user session, add --user, as in systemctl --user list-units --type=service --all. Containers that do not run systemd usually cannot return a system service list with these commands.
Read the state columns
- UNIT is the unit name, such as
ssh.service. - LOAD tells you whether systemd loaded the definition.
- ACTIVE gives the general state, such as
active,inactive, orfailed. - SUB gives the more specific state. An
active (exited)one-shot service can be working as intended with no process left running. - DESCRIPTION explains what the unit does.
In list-unit-files, enabled describes startup configuration. A disabled service can still run when started manually or triggered by another unit. The systemctl manual explains the other states.
Check a specific service and its logs
Use the exact name from the list. The SSH service is commonly ssh.service on Debian-based systems and sshd.service on others.
systemctl status ssh.service
sudo journalctl -u ssh.service -b -n 50 --no-pager
The journal command shows up to 50 recent messages from the current boot. Use journalctl -u ssh.service -f with sufficient permissions to follow new entries. For a network service, check the listening socket with ss after checking the unit state. If a service is delaying shutdown, see how to investigate a systemd stop job.
Manage a service after identifying it
Use sudo systemctl start NAME.service or stop NAME.service to change the current state. Use sudo systemctl enable NAME.service to configure future startup, or add --now if you also want to start it immediately. When an application supports reloading, sudo systemctl reload NAME.service applies its configuration without a full restart. If you edited a systemd unit file itself, run sudo systemctl daemon-reload so systemd rereads the definition.
Reader Comments 0
Sign in with email or Google to join the discussion.