← All cheatsheets

systemd (systemctl & journalctl) Cheatsheet

A systemd cheatsheet: control services and units with systemctl and read their logs with journalctl — copy-ready with editable placeholders. Timer entries link straight into the systemd Timer Generator.

Explain a command

Service control

  • Show a unit’s status
    systemctl status
    unit = service/unit name
  • Start a service now
    sudo systemctl start
  • Stop a service now
    sudo systemctl stop
  • Restart a service
    sudo systemctl restart
  • Reload config without dropping connections
    sudo systemctl reload

Enable at boot

  • Enable and start immediately
    sudo systemctl enable --now
  • Disable and stop immediately
    sudo systemctl disable --now
  • Is a unit enabled at boot?
    systemctl is-enabled
  • Mask a unit (prevent it starting at all)destructive
    sudo systemctl mask

Inspect units

  • List running units
    systemctl list-units --type=service --state=running
  • List failed units
    systemctl --failed
  • Show a unit file
    systemctl cat
  • Override a unit (drop-in)
    sudo systemctl edit
  • Reload systemd after editing unit files
    sudo systemctl daemon-reload

Timers

Logs (journalctl)

  • Follow a unit’s logs live
    journalctl -u -f
  • A unit’s logs since a time
    journalctl -u --since ""
    · since = e.g. "2024-01-01" or "10 min ago"
  • Logs from the current boot
    journalctl -b
  • Kernel messages (like dmesg)
    journalctl -k
  • Only errors and worse
    journalctl -p err -b
  • Trim the journal to a size
    sudo journalctl --vacuum-size=
    size = e.g. 200M, 1G

23 commands. Copy-ready with editable placeholders — everything runs in your browser, nothing is sent to a server.