Viewing unit files with systemctl

As a system administrator or user, sometimes it is necessary to find out the current status of systemd unit files. This helps in fine-tuning of system. We can configure services to be in active and loaded state or in an inactive state after booting of system, using the systemctl command.

The following table lists the commands used to view the unit files and their descriptions:

Command

Description

# systemctl

Displays the state of all the different units that are active and loaded on startup

# systemctl --type=service or

# systemctl list-units --type=service

Displays the state of only service units that are active

# systemctl --type=service –all or

# systemctl list-units --type=service --all

Displays the state of all service units loaded, whether active or inactive

# systemctl --failed --type=service

Displays all services that failed

# systemctl is-active sshd

Displays whether the particular service is currently active or not

# systemctl is-enabled sshd

Displays whether the particular service in enabled to start at boot time or not

# systemctl list-unit-files --type=service

Displays the enabled, disabled, or static settings of all units of the specified type

# systemctl status sshd.servisystemctlce -l

Displays detailed status information about the specified service

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.199.243