Linux systems run a variety of system services (daemons) in the background — such as process management, cron jobs, logging, SSH, DNS, web servers, and more. As a system administrator, it is essential to know how to list running services in Linux to ensure that critical services are active, unnecessary ones are disabled, and your server remains optimized for performance and security.
In this guide, we’ll explore multiple methods to list and manage services in Linux using systemctl and related commands. We’ll also cover how to check open ports, monitor services automatically, and even secure them for better stability.
Why List Running Services in Linux?
When you list running services in Linux, you get real-time visibility into what your system is doing. This helps with:
Monitoring resource usage – Spot services that consume CPU, RAM, or bandwidth.
Troubleshooting – Identify if a service is down (e.g., Apache, MySQL, SSH).
Security – Detect unauthorized or unnecessary background processes.
Optimization – Disable unwanted daemons to improve boot time and efficiency.
By regularly running commands to list running services in Linux, you maintain visibility and control over your infrastructure.
Enabled vs Running Services in Linux
It’s important to understand the difference between enabled and running services:
Enabled Services – Configured to start automatically at boot.
Running Services – Currently active in memory.
For example, a service may be enabled but not running yet (like cron waiting to be triggered). This distinction helps in troubleshooting why a service expected to run isn’t currently active.
List enabled services:
systemctl list-unit-files --type=service --state=enabled
List running services:
How to List Running Services in Linux with systemctl
The systemctl command is the most reliable way to list running services in Linux on modern distributions.
1. List All Services
systemctl list-units --type=service
or simply:
systemctl --type=service
This shows all loaded services, including active, exited, or failed ones.
2. List Only Active Services
This includes both running and exited services.
3. List Only Running Services
To list running services in Linux directly:
systemctl list-units --type=service --state=running
UNIT, LOAD, ACTIVE, SUB, and a description.4. Check Status of a Specific Service
This shows if SSH is running, its PID, recent logs, and whether it starts at boot.
5. List Failed Services
systemctl --failed
6. Create an Alias for Convenience
You can create a shortcut command in ~/.bashrc:
Now, type running_services anytime you need to list running services in Linux.
Check Which Ports Services Are Using
Services typically bind to ports (e.g., web server → port 80/443, SSH → port 22). To see which port a service is listening on:
or using ss command:
Listing Firewall Services and Ports
If you use a firewall (like firewalld or UFW), list allowed services and ports:
For FirewallD:
- For UFW:
Automating Service Monitoring in Linux
Manually checking services can be tedious. Instead, automate it:
Using Cron Job to Log Running Services
Add:
This logs running services every 5 minutes into /tmp/running_services.log.
Automatically Restart Failed Services
Edit a service configuration:
Add:
Reload systemd:
Hardening Services with systemd
Beyond just being able to list running services in Linux, securing them is vital:
[Service]
NoNewPrivileges=true
ProtectSystem=full
PrivateTmp=trueSummary
Use
systemctl list-units --type=service --state=runningto list running services in Linux.Distinguish between enabled (start at boot) and running (currently active) services.
Check service ports with
netstatorss.Monitor services automatically with cron jobs.
Restart failed services automatically with systemd directives.
Harden services using
NoNewPrivileges,ProtectSystem, andPrivateTmp.
Conclusion
Learning how to list running services in Linux is a must-have skill for system administrators. With systemctl, you can manage, troubleshoot, and secure services effectively. Combine monitoring tools, firewall configurations, and automation to maintain a stable and secure Linux environment.
Frequently Asked Questions (FAQ)
Q1. How do I list all running services in Linux?
Run: systemctl list-units –type=service –state=running
Q2. How can I check if a service is enabled at boot?
systemctl list-unit-files –type=service –state=enabled
Suggested Read:
- How to Auto Execute Commands During Startup in Linux
- How to Kill a Process (Terminate a running process) in Linux
- How Linux handles Processes
- How to manipulate Process Priority in Linux using nice and renice Commands
- Linux Networking Commands for Sysadmins: A Complete Guide
- Most Useful Linux Ping Command (Ping Utility) With Examples
- Best Linux Ifconfig Command With Examples
- How To Install Wireshark Network Analyzer In Ubuntu – A Best Network Traffic Analyzer For Linux
- Setup Netdata For Real Time Performance Monitor In Linux System
