How To See What Services Are Running In Linux : Checking Active Systemd Units

Knowing which services are currently active on your Linux machine helps you manage system resources and troubleshoot issues. If you are wondering how to see what services are running in linux, this guide covers every practical method you need. Whether you use systemd, SysV init, or older systems, you will find clear commands and examples.

Services are background processes that keep your system running—like web servers, SSH, or database daemons. Monitoring them helps you spot problems, free up memory, or disable unwanted tasks. Let’s jump straight into the most common approaches.

How To See What Services Are Running In Linux

The easiest way to list active services depends on your init system. Most modern Linux distributions use systemd, but some still rely on SysV init or Upstart. We will cover all three, plus a few universal tricks.

Using Systemctl With Systemd

If your system uses systemd (Ubuntu 16.04+, CentOS 7+, Debian 8+), the systemctl command is your best friend. Open a terminal and type:

systemctl list-units --type=service --state=running

This shows all active services with their status. You will see columns like UNIT, LOAD, ACTIVE, and SUB. For a more detailed view, add --all to include inactive services:

systemctl list-units --type=service --all

To see only enabled services that start at boot:

systemctl list-unit-files --type=service --state=enabled

If you want to check a single service, use:

systemctl status sshd

Replace sshd with any service name. This shows whether it is active, its PID, memory usage, and recent log entries.

Using Service Command For SysV Init

Older distributions or minimal installs may use SysV init. The service command works here. To list all services and their status:

service --status-all

This outputs a list with [ + ] for running, [ - ] for stopped, and [ ? ] for unknown. It is quick but less detailed than systemctl.

To check a specific service:

service apache2 status

For services managed by chkconfig, you can also run:

chkconfig --list

This shows which services are enabled at each runlevel. Note that chkconfig is deprecated in many distros but still available.

Checking With Ps And Grep

Sometimes you just want to see if a particular process is running. The ps command combined with grep works on any Linux system. For example:

ps aux | grep nginx

This lists all processes containing “nginx” in their name. The aux flags show all users, detailed output, and include processes without a terminal.

To see all running processes sorted by CPU or memory usage:

ps aux --sort=-%cpu

Or for memory:

ps aux --sort=-%mem

This is not service-specific but helps identify heavy processes that might be services.

Using Top Or Htop

Interactive process viewers like top or htop give a real-time overview. Run:

top

Press q to quit. You can filter by typing o and then COMMAND=service_name. Htop is more user-friendly if installed:

htop

Use F4 to search for a service name. Both tools show PID, CPU, memory, and uptime.

Listing Services With Systemctl List-Units

We already covered the basic command, but there are useful variations. To see only failed services:

systemctl --failed --type=service

To list all loaded services (including inactive):

systemctl list-units --type=service

You can also filter by state:

systemctl list-units --type=service --state=active

This includes running, exited, or waiting services. For a cleaner output, pipe to less:

systemctl list-units --type=service | less

Checking Services In Docker Containers

If you run services inside Docker, use docker ps to see running containers:

docker ps

To inspect a container’s processes:

docker top container_name

This shows the PID and command inside the container. For more detail, exec into the container and use ps:

docker exec -it container_name ps aux

Using Netstat Or Ss For Network Services

Network services like web servers or databases listen on ports. To see which services are listening:

ss -tlnp

This shows TCP listening sockets with the process name. The -p flag requires root for full details. Alternatively:

netstat -tlnp

Both commands list the service name and PID. For UDP services, use -u instead of -t.

Using Lsof To Find Service Processes

The lsof command lists open files, including network sockets. To see all processes listening on port 80:

lsof -i :80

To list all network connections:

lsof -i

This is helpful when you know the port but not the service name.

Checking Services With Journalctl

Systemd logs service activity via journalctl. To see logs for a specific service:

journalctl -u sshd

To see recent logs for all services:

journalctl --list-boots

Then check a specific boot:

journalctl -b -1

This does not list running services directly but helps diagnose why a service stopped.

Using Initctl For Upstart Systems

Ubuntu versions before 15.04 used Upstart. To list services:

initctl list

This shows all jobs with their status (start/running, stop/waiting). For a specific service:

initctl status ssh

Upstart is rare now but still found in some embedded systems.

Automating Service Checks With Scripts

You can write a simple bash script to check multiple services. For example:

#!/bin/bash
services=("sshd" "nginx" "mysql")
for s in "${services[@]}"; do
  systemctl is-active --quiet $s && echo "$s is running" || echo "$s is not running"
done

Save it as check_services.sh, make it executable with chmod +x, and run it. This is useful for monitoring.

Using Systemd Analyze

To see how long services take to start, use:

systemd-analyze blame

This lists services sorted by startup time. It does not show current running status but helps identify slow services.

Checking Services With Wmic (For WSL)

If you are using Windows Subsystem for Linux (WSL), services are managed differently. Use:

wmic service get name,state

This lists all Windows services, not just Linux ones. For WSL-specific processes, stick with ps.

Common Pitfalls And Tips

  • Some services run as user processes, not system services. Check with ps -u username.
  • Services may be masked (disabled completely). Use systemctl list-unit-files | grep masked.
  • If a service shows as “active (exited)”, it ran once and stopped. This is normal for oneshot services.
  • Use systemctl list-dependencies service_name to see what a service needs.

Comparing Methods By Use Case

Method Best For
systemctl list-units Systemd systems, detailed status
service –status-all SysV init, quick overview
ps aux | grep Any system, specific process
ss -tlnp Network services
docker ps Containerized services

Frequently Asked Questions

What Is The Difference Between Active And Enabled Services?

Active means the service is currently running. Enabled means it starts automatically at boot. A service can be active but not enabled (started manually) or enabled but not active (stopped).

How Can I See All Services Including Stopped Ones?

Use systemctl list-units --type=service --all for systemd, or service --status-all for SysV. For stopped services, look for [ - ] in the output.

Can I Check Services Without Sudo?

Yes, most commands like systemctl list-units and ps aux work without root. However, ss -p and netstat -p require root to show process names.

Why Does My Service Show As “Inactive (Dead)”?

This means the service is not running. It may have crashed, been stopped manually, or never started. Check logs with journalctl -u service_name for details.

How Do I Find Which Service Is Using A Specific Port?

Run ss -tlnp | grep :port_number or lsof -i :port_number. The output shows the PID and service name.

Now you have multiple ways to see running services on Linux. Start with systemctl list-units --type=service --state=running if you use systemd. For older systems, service --status-all works fine. Combine these with ps and ss for a complete picture. Practice these commands, and you will quickly master service management.

Remember to check logs when a service behaves unexpectedly. The journalctl command is invaluable for systemd users. For non-systemd systems, look in /var/log/ for service-specific logs.

If you manage multiple servers, consider writing a script to automate checks. This saves time and reduces human error. You can also set up monitoring tools like Nagios or Prometheus, but the command line is always there for quick checks.

Finally, keep your system updated. Service management commands evolve, but the core concepts remain the same. With these methods, you can confidently answer “how to see what services are running in linux” on any distribution.