- How to List All Running Services Under Systemd in Linux
- Listing Running Services Under SystemD in Linux
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Linux List All Users In The System Command
- Linux list all users account using the /etc/passwd file
- How to list users in Linux using pagers
- Linux list user names only
- Get a list of all users using the getent command
- Find out whether a user account exists in the Linux server
- How to count user accounts in the Linux server
- A Note About System and General Users
- How to List Services in Linux
- Check and Listing linux services (systemd on Centos/RHEL 7.x)
- Listing services using Netstat Command
- Viewing /etc/services file
- Systemd services status check
- Checking the status of services in older systems (Centos/Rhel 6.x)
- How to List Services in Ubuntu Server / Desktop
- List Ubuntu Services with Service command
- List Services with systemctl command
How to List All Running Services Under Systemd in Linux
A Linux systems provide a variety of system services (such as process management, login, syslog, cron, etc.) and network services (such as remote login, e-mail, printers, web hosting, data storage, file transfer, domain name resolution (using DNS), dynamic IP address assignment (using DHCP), and much more).
Technically, a service is a process or group of processes (commonly known as daemons) running continuously in the background, waiting for requests to come in (especially from clients).
Linux supports different ways to manage (start, stop, restart, enable auto-start at system boot, etc.) services, typically through a process or service manager. Most if not all modern Linux distributions now use the same process manager: systemd.
Systemd is a system and service manager for Linux; a drop-in replacement for the init process, which is compatible with SysV and LSB init scripts and the systemctl command is the primary tool to manage systemd.
In this guide, we will demonstrate how to list all running services under systemd in Linux.
Listing Running Services Under SystemD in Linux
When you run the systemctl command without any arguments, it will display a list of all loaded systemd units (read the systemd documentation for more information about systemd units) including services, showing their status (whether active or not).
To list all loaded services on your system (whether active; running, exited or failed, use the list-units subcommand and —type switch with a value of service.
List All Services Under Systemd
And to list all loaded but active services, both running and those that have exited, you can add the —state option with a value of active, as follows.
List All Active Running Services in Systemd
But to get a quick glance of all running services (i.e all loaded and actively running services), run the following command.
List Running Services in Systemd
If you frequently use the previous command, you can create an alias command in your
/.bashrc file as shown, to easily invoke it.
Then add the following line under the list of aliases as shown in the screenshot.
Create a Alias for Long Command
Save the changes in the file and close it. And from now onwards, use the “running_services” command to view a list of all loaded, actively running services on your server.
View All Running Services
Besides, an important aspect of services is the port they use. To determine the port a daemon process is listening on, you can use the netstat or ss tools as shown.
Where the flag -l means print all listening sockets, -t displays all TCP connections, -u shows all UDP connections, -n means print numeric port numbers (instead of application names) and -p means show application name.
The fifth column shows the socket: Local Address:Port. In this case, the process zabbix_agentd is listening on port 10050.
Determine Process Port
Also, if your server has a firewall service running, which controls how to block or allow traffic to or from selected services or ports, you can list services or ports that have been opened in the firewall, using the firewall-cmd or ufw command (depending on the Linux distributions you are using) as shown.
List Open Services and Ports on Firewall
That’s all for now! In this guide, we demonstrated how to view running services under systemd in Linux. We also covered how to check the port a service is listening on and how to view services or ports opened in the system firewall. Do you have any additions to make or questions? If yes, reach us using the comment form below.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник
Linux List All Users In The System Command
Tutorial requirements | |
---|---|
Requirements | Linux |
Root privileges | No |
Difficulty | Easy |
Est. reading time | 5 mintues |