LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

systemctl

Control systemd services and system

TLDR

Show all running services
$ systemctl status
copy
List failed units
$ systemctl --failed
copy
Start/Stop/Restart a service
$ systemctl start|stop|restart unit
copy
Enable/Disable a service at boot
$ systemctl enable|disable unit
copy
Reload systemd configuration
$ systemctl daemon-reload
copy
Check if a unit is active/enabled/failed
$ systemctl is-active|is-enabled|is-failed unit
copy
List all service units by state
$ systemctl list-units -t service --state running
copy
Show contents of a unit file
$ systemctl cat unit
copy

SYNOPSIS

systemctl [OPTIONS...] COMMAND [UNIT...]

DESCRIPTION

systemctl controls the systemd system and service manager. It can be used to introspect and control the state of the systemd system, manage services, check unit dependencies, and perform system operations like reboot or shutdown.

PARAMETERS

-t, --type=TYPE

Filter by unit type (service, socket, target, mount, timer, etc.)
--state=STATE
Filter by unit state (active, inactive, failed, running, etc.)
-a, --all
Show all units including inactive ones
--user
Manage user services instead of system services
--no-block
Return immediately without waiting for operation to complete
--now
Combine enable/disable with start/stop
--force
Override safety checks or symlink conflicts
-q, --quiet
Suppress output
-n, --lines=NUM
Number of journal lines to show with status
--no-pager
Do not pipe output into a pager
-o, --output=FORMAT
Control journal output format (short, verbose, json, etc.)

COMMON COMMANDS

list-units: List active or specified unitslist-unit-files: Show installed unit files and their enablement statestatus: Show runtime status and recent logsstart/stop: Start or stop unitsrestart: Stop then start unitsreload: Reload unit configuration without stoppingenable/disable: Enable or disable unit activation at bootmask/unmask: Completely disable or re-enable a unitedit: Edit unit file with drop-in snippetscat: Show contents of unit fileshow: Display unit properties in machine-readable formatdaemon-reload: Reload systemd configuration and unit filesis-active/is-enabled/is-failed: Check unit statekill: Send signal to unit processespoweroff/reboot/halt: System power commandssuspend/hibernate: Enter sleep states

CAVEATS

Some commands require root privileges. The --user flag manages per-user services in ~/.config/systemd/user/. Use daemon-reload after modifying unit files. Masked units cannot be started even manually.

HISTORY

systemctl is part of systemd, introduced in 2010 by Lennart Poettering. It replaced traditional SysV init scripts and service management tools like service and chkconfig.

SEE ALSO

Copied to clipboard
Kai