HomeCheat SheetsLinux systemctl & journalctl (systemd) Cheat Sheet
100% Client-Side β€’ 0 B Data Leaves Browser
linux

Linux systemctl & journalctl (systemd) Cheat Sheet

Essential systemd command reference for Linux server administrators. Managing services, units, boot targets, timers, and streaming system logs.

Service Lifecycle Management

Start a stopped system service immediatelysudo systemctl start <service>
Stop a running system service immediatelysudo systemctl stop <service>
Stop and restart servicesudo systemctl restart <service>
Reload configuration without dropping active connectionssudo systemctl reload <service>
View service state, PID, memory, and recent log messagessudo systemctl status <service>

Enabling on Boot & Daemon Reload

Configure service to automatically launch on system bootsudo systemctl enable <service>
Prevent service from launching on system bootsudo systemctl disable <service>
Reload all systemd unit configuration files after editingsudo systemctl daemon-reload
Returns 0 if service is currently running (script friendly)systemctl is-active <service>
Check if service is configured to launch on bootsystemctl is-enabled <service>

Streaming Logs with journalctl

Follow live streaming log output for a specific servicejournalctl -u <service> -f
Show the last 100 log lines for a specific servicejournalctl -u <service> -n 100
Filter logs generated within the last hourjournalctl -u <service> --since "1 hour ago"
Show all error-level logs from current boot sessionjournalctl -p err -b
Clean up journal logs older than 3 days to free disk spacesudo journalctl --vacuum-time=3d

Frequently Asked Questions

β€’ Why do I need to run systemctl daemon-reload?

systemd caches unit files in memory. If you edit, create, or delete a `.service` file under `/etc/systemd/system/`, you must execute `systemctl daemon-reload` so systemd re-reads the updated configuration.