systemd command snippets
Copy-paste-ready systemctl and journalctl commands for common service management tasks.
- systemd command snippets
- List All Running systemd Services
- List All Failed systemd Services
- Show the Full Unit File for a systemd Service
- List All systemd Timers with Next Run Time
- View systemd Journal for the Current Boot Only
- View systemd Journal Entries by Priority Level
- Show Disk Usage of the systemd Journal
- Rotate and Vacuum the systemd Journal
- Analyze systemd Boot Time
- Reset a Failed systemd Service
systemd command snippets
Copy-paste-ready systemctl and journalctl commands for common service management tasks.
List All Running systemd Services
systemctl lists all active service units with their state:
systemctl list-units --type=service --state=runningList All Failed systemd Services
systemctl shows services that failed to start:
systemctl list-units --type=service --state=failedShow the Full Unit File for a systemd Service
systemctl displays the merged unit file including all drop-in overrides:
systemctl cat nginx.serviceList All systemd Timers with Next Run Time
systemctl shows all timers with their next and last trigger times:
systemctl list-timers --allView systemd Journal for the Current Boot Only
journalctl filters entries to the current boot session:
journalctl -bView systemd Journal Entries by Priority Level
journalctl shows only error-level and higher messages:
journalctl -p err -bShow Disk Usage of the systemd Journal
journalctl reports the total size of stored journal files:
journalctl --disk-usageRotate and Vacuum the systemd Journal
journalctl removes old entries to free disk space. Keep only the last 500 MB:
sudo journalctl --vacuum-size=500MAnalyze systemd Boot Time
systemd-analyze shows the total boot time and the slowest services:
systemd-analyze
systemd-analyze blameReset a Failed systemd Service
systemctl clears the failed state so the service can be restarted:
sudo systemctl reset-failed myapp.service