How can I list all running and installed services on an Ubuntu machine using the least number of commands?

I’m using a Linux system (Ubuntu 16.04 or newer) and want to check all currently running services as well as the full list of installed ones.

What’s the most efficient way, ideally with just one or a few commands, to perform an ubuntu list services operation showing both active and available services?

If you’re using Ubuntu 16.04 or later, the easiest way I’ve found is using systemctl, it’s part of systemd.

To list all installed services, run:

bash
Copy
Edit
systemctl list-unit-files --type=service

And to see only active/running services:

bash
Copy
Edit
systemctl list-units --type=service --state=running

Two simple commands very clean and reliable.

I’ve automated this in audit scripts as well.

Agreed with @jacqueline-bosco. Just to add, if you want a single command that combines everything, I sometimes use this trick when doing health checks:


bash
Copy
Edit
systemctl --no-pager | grep service

It lists all services and their current states in one go.

You won’t get quite as clean a view as with list-units, but it’s fast when I just need an overview.

@Apurvaugale I used to get confused between service --status-all and systemctl.

On older Ubuntu (pre-16.04), service was the go-to:

bash
Copy
Edit
service --status-all

But for newer systems, I stick with:

bash
Copy
Edit
systemctl list-units --type=service

That shows running services. And for the full list, just swap in list-unit-files.

Super handy once you memorize them.