Skip to main content

Top 20 systemd Commands Every Linux Admin Should Know

·340 words·2 mins
Linux systemd Sysadmin DevOps Automation
Author
Emre Hayta - System Engineer
Table of Contents

Systemd is the backbone of modern Linux distributions — handling services, logging, targets, startup sequences, timers, sockets, crash diagnostics, and more.

Whether you’re maintaining servers, containers, homelabs, or enterprise infrastructure, mastering systemd is essential for efficient troubleshooting and smooth operations.

In this guide, you’ll learn the 20 most important systemd commands that every Linux administrator should know, with real examples and best practices.


🔧 1. Check Service Status
#

systemctl status <service>

▶️ 2. Start a Service
#

sudo systemctl start <service>

⏹️ 3. Stop a Service
#

sudo systemctl stop <service>

🔁 4. Restart a Service
#

sudo systemctl restart <service>

🔄 5. Reload a Service
#

sudo systemctl reload <service>

🚀 6. Enable Service at Boot
#

sudo systemctl enable <service>

🛑 7. Disable Service at Boot
#

sudo systemctl disable <service>

🧱 8. Mask / Unmask a Service
#

sudo systemctl mask <service>
sudo systemctl unmask <service>

🧩 9. Check All Failed Services
#

systemctl --failed

📜 10. View Logs for a Service
#

journalctl -u <service>

🚨 11. Last 100 Log Lines
#

journalctl -u <service> -n 100

🕒 12. View Logs Since a Time
#

journalctl -u <service> --since "2 hours ago"

📅 13. Check Boot History
#

journalctl --list-boots

📦 14. List All Services
#

systemctl list-units --type=service

🎯 15. Show Current Target
#

systemctl get-default

🎛️ 16. Change Boot Target
#

sudo systemctl set-default graphical.target
sudo systemctl set-default multi-user.target

⏲️ 17. List All Timers
#

systemctl list-timers

⛔ 18. Shut Down
#

sudo systemctl poweroff

🔄 19. Reboot
#

sudo systemctl reboot

💥 20. Analyze Failed Boots
#

systemd-analyze
systemd-analyze blame
systemd-analyze critical-chain

🧠 Best Practices for Using systemd
#

✔ Use journalctl -xe for quick troubleshooting
✔ Keep overrides in /etc/systemd/system/<service>.d/override.conf
✔ Use timers instead of cron where possible
✔ Mask unused services
✔ Test reload before restart using:

systemctl reload-or-restart <service>

🚀 Need Help Managing Linux Servers?
#

At TechZ (techz.at), we help companies harden Linux servers, fix failing services, and implement best-practice configurations.

👉 Need expert help? Reach out anytime.