banner



How To View All Running Services On Ubuntu

You need to know what services are running on your system. And today, we'll talk almost how you can list all services in Ubuntu. Services are the groundwork applications that are available for the proper functioning of a Linux system. Whenever the system requires a specific service, it enables it. In Ubuntu, systemd is responsible for the handling of the organisation and its services.

In this article, we will look at diverse methods of listing services available in our organization.

Using the service control

As the name suggests, the service control lists the services also as their status on the final. Nosotros run the command:

List Services Service Command
List Services using 'service' command

Running the control for the first time may accept a while since it collects the services from '/etc/init.d/'directory. The symbols before the proper noun of each service announce the status of the service. '[ + ]' represents a running service whereas '[ - ]' means a stopped service.


i. Display only running services

It is fairly simple to extract merely the running services from the service command, provided the user has the knowledge of grep command. It is done by:

service --status-all | grep '\[ + \]'                
List Services Running
List running services

The grep command is a Linux tool for capturing certain patterns or words from text. The pipe '|' symbol denotes the transfer of output of one command to the input of the following command.


2. Extract but stopped services

Similarly, the higher up method can be used to list all the stopped services by:

service --status-all | grep '\[ - \]'                
List Services Stopped
Listing stopped services

List services directly from /etc/init.d

After knowing the fact that, service control extracts services from /etc/init.d directory, we can list the contents of the directory to featherbed the source code run every fourth dimension for the service command.

List Services Ls Command
List services direct from '/etc/init.d'

The ls command is used to list the contents of any directory in Linux. The green color for each filename denotes an executable file.

The only drawback using this method to list all services in Ubuntu is that we can not effigy out the status of each service.


Using the systemctl command

systemctl stands from systemd command, that is, this command is responsible for actions of systemd. In social club to list all the available services, nosotros run:

systemctl --type service --all                
List Services Systemctl All
List all services using 'systemctl'

systemctl provides a ton of information every bit compared to the service control, the reason beingness that systemctl is a primary command for the manager of system's services, systemd.

Let us understand each cavalcade in the output:

  • Unitsystemd regards every resource information technology manages every bit a unit of measurement. Hither, UNIT denotes a service name.\
  • LOAD – Whether the service was loaded into the memory after boot up.
  • Agile – Whether the service is currently agile or inactive.
  • SUB – The electric current state of the service.
  • DESCRIPTION – A short clarification of the detail service.

In that location tin can be few filters applied to the above command to fetch certain results.


1. List merely the loaded and active services

In lodge to list merely the loaded and active services, we will omit the -all choice.

List Services Loaded Services
List simply Loaded Services

The output columns remain same as before. Whenever we run the systemctl command, a short statistic is also presented at the cease of the output.

List Services Stats
'systemctl' Terminate Statistic

In the figure we can detect out the number of loaded units/services in our system.


2. Listing but running services

To list only the running services, nosotros run:

systemctl --blazon service --state running                
List Services Systemctl Running
List just running services

It is quite obvious that only the loaded and active services, would be running. Therefore, we can omit the --all option from the control. To find out the number of running services, we can curl to the lesser of the output.


3. List only the stopped services

We can list the stopped/exited services by:

systemctl --blazon service --all --country exited                
List Services Stopped Systemctl
List but stopped services

Similarly using the active , inactive or loaded states, nosotros tin filter the list of services as per our need.


Conclusion

The easiest way of listing services is using the service command, but information technology lacks information virtually the service, where systemctl is more useful. The use of any control depends on the context of the user's needs.

We hope this article provided plenty data related to the listing of services in Ubuntu or other Linux distributions. Feel free to annotate below if we missed whatever method.

How To View All Running Services On Ubuntu,

Source: https://www.linuxfordevices.com/tutorials/linux/list-all-services-in-ubuntu

Posted by: bixbymairaguent.blogspot.com

0 Response to "How To View All Running Services On Ubuntu"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel