Skip to content

Commit

Permalink
update systemctl cli guide
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvuvuong authored and vanvuvuong committed May 10, 2024
1 parent dcaae37 commit 4e67952
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pages/linux/systemctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@

`systemctl --failed`

- Start/Stop/Restart/Reload a service:
- Start/Stop/Restart/Reload/Show the status a service:

`systemctl {{start|stop|restart|reload}} {{unit}}`

- Show the status of a unit:

`systemctl status {{unit}}`
`systemctl {{start|stop|restart|reload|status}} {{unit}}`

- Enable/Disable a unit to be started on bootup:

`systemctl {{enable|disable}} {{unit}}`

- Mask/Unmask a unit to prevent enablement and manual activation:
- Reload systemd, scan for new or changed units:

`systemctl daemon-reload`

`systemctl {{mask|unmask}} {{unit}}`
- Check if a unit is active/enabled/failed:

- Reload systemd, scanning for new or changed units:
`systemctl {{is-active|is-enabled|is-failed}} {{unit}}`

`systemctl daemon-reload`
- List all service/socket/automount units filtering by running/failed state:

`systemctl list-units --type={{service|socket|automount}} --state={{failed|running}}`

- Check if a unit is enabled:
- Show the contents & absolute path of a unit file:

`systemctl is-enabled {{unit}}`
`systemctl cat {{unit}}`

0 comments on commit 4e67952

Please sign in to comment.