xutil.dev
Login

systemd Cheatsheet

Quick reference for systemd commands covering service management, unit files, journalctl, timers, targets, systemd-analyze, and sockets

68 commands

systemctl start

Start a service

systemctl stop

Stop a service

systemctl restart

Restart a service

systemctl reload

Reload service configuration

systemctl status

Show service status

systemctl enable

Enable service at boot

systemctl disable

Disable service at boot

systemctl enable --now

Enable and start service

systemctl is-active

Check if service is active

systemctl is-enabled

Check if service is enabled

systemctl is-failed

Check if service is failed

systemctl mask

Mask service to prevent start

systemctl unmask

Unmask a service

systemctl list-units

List active units

systemctl list-units --type=service

List service units

systemctl list-units --failed

List failed units

systemctl list-unit-files

List all unit files

systemctl cat

Show unit file contents

systemctl show

Show unit properties

systemctl edit

Edit unit override

systemctl edit --full

Edit full unit file

systemctl daemon-reload

Reload unit file changes

systemctl list-dependencies

Show unit dependencies

systemctl reset-failed

Reset failed units

journalctl

Show all journal logs

journalctl -u

Show logs for specific unit

journalctl -f

Follow logs in real-time

journalctl -u -f

Follow specific unit logs

journalctl --since

Show logs since specific time

journalctl --since --until

Show logs in time range

journalctl -p

Filter logs by priority

journalctl -b

Show logs from current boot

journalctl -b -1

Show logs from previous boot

journalctl --disk-usage

Show journal disk usage

journalctl --vacuum-size

Vacuum journal to size limit

journalctl --vacuum-time

Vacuum journal older than time

journalctl -o json

Output logs in JSON format

systemctl list-timers

List active timers

systemctl list-timers --all

List all timers

systemctl start timer

Start a timer

systemctl stop timer

Stop a timer

systemctl enable timer

Enable timer at boot

systemd-run --on-calendar

Create transient timer (calendar)

systemd-run --on-active

Run once after delay

systemctl get-default

Show default target

systemctl set-default

Set default target

systemctl isolate

Switch to target

systemctl rescue

Switch to rescue mode

systemctl emergency

Switch to emergency mode

systemctl poweroff

Power off the system

systemctl reboot

Reboot the system

systemctl suspend

Suspend the system

systemd-analyze

Analyze boot time

systemd-analyze blame

Show boot time per unit

systemd-analyze critical-chain

Show critical chain of boot

systemd-analyze plot

Generate SVG boot time plot

systemd-analyze verify

Verify unit file syntax

systemd-analyze dot

Generate DOT dependency graph

systemd-analyze security

Analyze service security settings

systemd-cgls

Show control group hierarchy

systemd-cgtop

Show cgroup resource usage

systemctl list-sockets

List socket units

systemctl start socket

Start a socket unit

loginctl list-sessions

List login sessions

loginctl list-users

List logged-in users

hostnamectl

Show or set hostname

timedatectl

Show or set time and timezone

localectl

Show or set locale settings