Home » Posts tagged 'list services ubuntu 20.04'
Tag Archives: list services ubuntu 20.04
How to list services in Ubuntu 22.04 / 20.04 / 18.04 : Command guide
In this tutorial we are going to learn how to list services in Ubuntu 22 / Ubuntu 20 / Ubuntu 18 using the command line interface. We will see how we can list running services and services that are not running.
Ubuntu list all services systemctl, systemctl list all services, List running services in Ubuntu 22 / Ubuntu 20 / Ubuntu 18
Ubuntu: How do I list all of the services on my Ubuntu 22.04 or Ubuntu 20.04 or Ubuntu 18.04 system from the Linux command line / Terminal ? How to list running services on Ubuntu 22.04 / Ubuntu 20.04 ?
Answer: Use this command:
service --status-all
Here’s an example of what this looks like on an Ubuntu 18.04 LTS system:
The meaning of the Ubuntu service
command output
From the Ubuntu Linux service
man page:
service --status-all
runs all init scripts, in alphabetical order, with the status
command. The status is:
[ + ]
running services[ - ]
stopped services[ ? ]
services without a ‘status’ command
This option only calls status for sysvinit jobs; upstart jobs can be queried in a similar manner with initctl list
.
How to show the Ubuntu version
In a slightly-related note, you can show your Ubuntu version information with the lsb_release -a
command:
root> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
Also read :
How to List Services in Ubuntu 20.04 / Ubuntu 18.04 using command
In this tutorial we are going to learn how to list services in Ubuntu 20 using the command line interface. We will see how we can list running services and services that are not running.
List Ubuntu Services with Service command
The service –status-all command will list all services on your Ubuntu Server (Both running services and Not running Services).
service --status-all
This will show all available services on your Ubuntu System. The status is [ + ] for running services, [ – ] for stopped services.
Using the grep command, we can filter the output to show only the running services.
service --status-all | grep '\[ + \]'
To list ubuntu services that are not running, Type,
service --status-all | grep '\[ - \]'
The service command can be used to list services in all Ubuntu releases, including (Ubuntu 20.04, 18.04, 16.04, and 14.04).
List Services with systemctl command
Since Ubuntu 15, the services are managed by the systemd. With systemd we can use systemctl command to get information about running services in our Ubuntu system.
To list all running services on Ubuntu, Type:
systemctl list-units
The output of the command will look something like this:
UNIT LOAD ACTIVE SUB DESCRIPTION
apache2.service loaded active running LSB: Apache2 web server
apparmor.service loaded active exited LSB: AppArmor initialization
cron.service loaded active running Regular
networking.service loaded active exited Raise network interfaces
nmbd.service loaded active running LSB: start Samba NetBIOS nameserver (nmbd)
smbd.service loaded active running LSB: start Samba SMB/CIFS daemon (smbd)
ssh.service loaded active running OpenBSD
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
To list all services, including inactive units, Type:
systemctl list-units -a
To List inactive unit, Type:
systemctl list-units -a --state=inactive
The systemctl command does not work for Ubuntu 14.04 and earlier releases, instead use the service –status-all command mentioned above.
Also read: How to list all services in Ubuntu 20.04