commands.sh

systemctl

linux

Control the systemd system and service manager. Some subcommands such as `disable`, `status`, `reboot` etc. have their own usage documentation.

More info →

Subcommands (37)

systemctl bind

Ephemerally bind-mount a file or directory from the host into a unit's mount namespace.

systemctl cancel

Cancel one or more pending jobs in the system manager or user manager.

systemctl cat

Show the full contents of unit files as systemd sees them.

systemctl condreload

This command is an alias of `systemctl try-reload-or-restart`.

systemctl condrestart

This command is an alias of `systemctl try-restart`.

systemctl condstop

This command is an alias of `systemctl stop`.

systemctl default

Enter system default mode.

systemctl disable

Disable systemd services. See also: `systemctl revert`.

systemctl edit

Edit systemd unit files. See also: `systemctl revert`.

systemctl emergency

Enter emergency mode `emergency.target`.

systemctl enable

Enable systemd services. See also: `systemctl revert`.

systemctl exit

Ask the service manager to quit.

systemctl freeze

Freeze one or more units. Frozen units can be resumed with `systemctl thaw`.

systemctl-halt

Shut down and halt the system (stop the OS kernel but keep hardware powered on). See also: `halt`.

systemctl help

Show the manual pages for one or more units, or for the unit a process belongs to (by PID).

systemctl hibernate

Hibernate the system by saving the current state to disk and powering off.

systemctl isolate

Start the specified unit with its dependencies and stop all others. Ignores the units which have `IgnoreOnIsolate=yes`.

systemctl kexec

Reboot the system via kexec.

systemctl kill

Send a signal to one or more processes of a unit.

systemctl link

Link a unit file located outside the unit file search path into the search path. See also: `systemctl disable`.

systemctl mask

Link units to `/dev/null` so that they cannot be started. See also: `systemctl revert`.

systemctl-poweroff

Power off the system. See also: `poweroff`.

systemctl preset

Reset the enablement state of unit files to the defaults specified in preset policy files. See also: `systemctl preset-all`, `systemctl list-unit-files`.

systemctl reboot

Reboot the system.

systemctl reenable

Re-enable one or more units. Used when targets of a service change.

systemctl reload

Reload a service's configuration without restarting it. This reloads the service itself (like Apache or `nginx` configs), not the systemd unit file. To reload unit files, use `systemctl daemon-reload`.

systemctl rescue

Enter rescue mode. See also: `systemctl emergency`.

systemctl restart

Stop and then start one or more systemd units. Can be used in place of `systemctl start` on a stopped unit, but `start` is safer so that a running unit isn't accidentally restarted.

systemctl revert

Revert unit files to their vendor versions. Undoes the effects of `edit`, `enable`, `disable`, `set-property`, and `mask`.

systemctl show

Show properties of units or systemd itself.

systemctl start

Start systemd units.

systemctl status

Display the status of systemd units.

systemctl stop

Stop systemd units.

systemctl suspend

Suspend the system.

systemctl thaw

Thaw (resume) one or more frozen units. Units can be frozen with `systemctl freeze`.

systemctl unmask

Unmask units to make them startable again. This undoes the effect of `systemctl mask`.

systemctl whoami

Show units that processes belong to. If no PID is specified, shows the unit the `systemctl` command itself is invoked in.

Options (1)

-t, --typeboolean

List all service/socket/automount units filtering by running/failed state

Example: systemctl list-units {{[-t|--type]}} {{service|socket|automount|...}} --state {{failed|running}}

Examples (8)

Show all running services

List failed units

systemctl --failed

Start/Stop/Restart/Reload/Show the status of a service

systemctl start|stop|restart|reload|status unit

Enable/Disable a unit to be started on bootup

systemctl enable|disable unit

Reload systemd, scan for new or changed units

Check if a unit is active/enabled/failed

systemctl is-active|is-enabled|is-failed unit

List all service/socket/automount units filtering by running/failed state

systemctl list-units [-t|--type] service|socket|automount|... --state failed|running

Show the contents & absolute path of a unit file or edit it

systemctl cat|edit unit
made by @shridhargupta | data from tldr-pages