Systemd Commands

Systemctl and journalctl commands for service management.

Service Control

systemctl start service.service

Start a service

systemctl stop service.service

Stop a service

systemctl restart service.service

Restart a service

systemctl reload service.service

Reload service configuration

systemctl status service.service

Show service status

systemctl enable service.service

Enable service at boot

systemctl disable service.service

Disable service at boot

systemctl is-enabled service.service

Check if service is enabled

systemctl is-active service.service

Check if service is running

Listing & Viewing

systemctl list-units

List all loaded units

systemctl list-units --type=service

List all services

systemctl list-units --state=running

List running units

systemctl list-units --failed

List failed units

systemctl list-unit-files

List all unit files

systemctl list-dependencies service.service

Show service dependencies

systemctl list-sockets

List socket units

systemctl list-timers

List timer units

System State

systemctl reboot

Reboot the system

systemctl poweroff

Power off the system

systemctl suspend

Suspend the system

systemctl hibernate

Hibernate the system

systemctl hybrid-sleep

Hybrid sleep mode

systemctl rescue

Enter rescue mode

systemctl emergency

Enter emergency mode

Unit Files

systemctl cat service.service

Show unit file contents

systemctl edit service.service

Edit unit file with override

systemctl edit --full service.service

Edit complete unit file

systemctl daemon-reload

Reload systemd configuration

systemctl show service.service

Show all unit properties

systemctl mask service.service

Mask a unit (prevent start)

systemctl unmask service.service

Unmask a unit

Logs & Journal

journalctl

Show all journal entries

journalctl -u service.service

Show logs for specific service

journalctl -f

Follow journal in real-time

journalctl -b

Show logs from current boot

journalctl -b -1

Show logs from previous boot

journalctl --since "1 hour ago"

Show logs from last hour

journalctl --since today

Show logs from today

journalctl -p err

Show only error messages

journalctl -n 50

Show last 50 log entries

journalctl --disk-usage

Show journal disk usage

Targets

systemctl get-default

Show default target

systemctl set-default multi-user.target

Set default target to multi-user

systemctl isolate graphical.target

Switch to graphical target

systemctl list-units --type=target

List all targets

Timers

systemctl list-timers --all

List all timers

systemctl start timer.timer

Start a timer

systemctl enable timer.timer

Enable timer at boot

systemctl status timer.timer

Show timer status

Advanced

systemctl daemon-reexec

Reexecute systemd manager

systemctl reset-failed

Reset failed state for all units

systemctl reset-failed service.service

Reset failed state for service

systemctl set-property service Mem=1G

Set runtime property

systemd-analyze

Show boot time analysis

systemd-analyze blame

Show service startup times

systemd-analyze critical-chain

Show critical chain of services

systemd-analyze verify service.service

Verify unit file syntax