Show Menu
Cheatography

Managing Linux using systemd Cheat Sheet by

Understanding systemd and commands that can be used.

Systemd Units

Unit
Extension
Purpose
Service
.service
Background servic­e/d­aemon
Target
.target
Group of units (runlevel replac­ement)
Socket
.socket
Socket activation
Timer
.timer
Scheduled task (cron altern­ative)
Mount
.mount
Automa­tically mount filesystem
Automount
.automount
Hardware devices
Device
.device
Hardware devices
Path
.path
Monitor file/d­ire­ctory changes
Swap
.swap
Swap device
Scope
.scope
External processes
Slice
.slice
Resource grouping
systemctl list-units
-> Running units
systemctl list-u­nit­-files
-> Installed unit files

Systemctl Utilities

Command
Purpose
systemctl status
View service status
systemctl start
Start service
systemctl stop
Stop service
systemctl restart
Restart service
systemctl reload
Reload config­uration
systemctl enable
Start at boot
systemctl is-enabled
Check boot status
systemctl mask
Prevent service from starting
systemctl unmask
Remove mask
systemctl daemon­-reload
Reload unit files
systemctl isolate
Switch target
 

journalctl

Command
Purpose
journalctl
View logs
journalctl -u sshd
Logs for a service
journalctl -xe
Recent errors
journalctl -f
Follow logs live
journalctl -b
Current boot logs
 

Managing Unit States

State
Meaning
Active
Currently running
Inactive
Not running
Enabled
Starts automa­tically at boot
Disabled
Does not start automa­tically
Masked
Cannot be started
Failed
Service encoun­tered an error
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          Vim NERDTree Cheat Sheet

          More Cheat Sheets by hlhlhl

          Linux File and Directory Commands Cheat Sheet
          Managing Processes and Jobs in Linux Cheat Sheet