Master Linux System Services: List, Check, and Manage with systemd & netstat
This guide explains how to list all running Linux services, inspect their status, and examine service configurations using systemd commands, netstat, and the /etc/services file on CentOS/RHEL and older SysV init systems.
Linux system services (daemons) start automatically at boot and stop on shutdown. This article shows how to list all running services and check their status on CentOS/RHEL 7.x and older SysV init systems using systemd, netstat, and the /etc/services file.
Viewing systemd services on CentOS/RHEL 7.x
CentOS 7 uses systemd, replacing traditional daemon commands with systemctl. To list unit files:
systemctl list-unit-filesTo list all active services:
systemctl | moreTo list only services:
systemctl list-units --type serviceYou can pipe the output to grep to search for a specific service, e.g.:
systemctl | grep "apache2"Using netstat to view services and listening ports
The netstat command displays active network connections, interface statistics, and routing tables. To show services and their listening ports:
netstat -pnltuInspecting the /etc/services file
The file /etc/services is an ASCII list of service names, port numbers, protocols, and aliases. You can view it with any text editor, for example:
vim /etc/servicesChecking the status of a specific systemd service
Use systemctl status <service_name> to see detailed status. Example for OpenSSH:
systemctl status sshdTo test whether a service is active:
systemctl is-active sshdTo check if a service is enabled at boot:
systemctl is-enabled sshdViewing service status on older SysV init systems
On systems still using SysV init, the service command reports status. Example for OpenSSH:
service sshd statusTo list all services and their statuses, you can use:
chkconfig --listSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
