Skip to content

Commit

Permalink
Merge pull request denisidoro#14 from 3duard0/cheats-systemctl
Browse files Browse the repository at this point in the history
Cheatsheet for handling systemctl services.
  • Loading branch information
denisidoro authored Sep 21, 2019
2 parents ef8756c + 696dba1 commit d517fa6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions cheats/systemctl.cheat
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
% systemctl, service

# Start service
systemctl start <service_inactive>

# Stop service
systemctl stop <service_active>

# Enable service
systemctl enable <service_disabled>

# Disable service
systemctl disable <service_enabled>

# Restart service
systemctl restart <service>

# Reload service
systemctl reload <service_active>

# Service status
systemctl status <service>

# List running services
systemctl list-units --type=service --state=running

# List enabled services
systemctl list-unit-files --type=service --state=enabled

# List disabled services
systemctl list-unit-files --type=service --state=disabled

$ service_inactive: systemctl list-units --type=service --state=inactive | awk '{print $1}' | grep .service | sed 's/.service$//'
$ service_active: systemctl list-units --type=service --state=active | awk '{print $1}' | grep .service | sed 's/.service$//'
$ service_enabled: systemctl list-unit-files --type=service --state=enabled | awk '{print $1}' | grep .service | sed 's/.service$//'
$ service_disabled: systemctl list-unit-files --type=service --state=disabled | awk '{print $1}' | grep .service | sed 's/.service$//'
$ service: systemctl list-units --type=service --all | awk '{print $1}' | grep .service | sed 's/.service$//'
2 changes: 1 addition & 1 deletion navi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ source "${SCRIPT_DIR}/src/main.sh"
##? --print Prevent script execution [default: false]
##? --no-interpolation Prevent argument interpolation [default: false]

VERSION="0.6.0"
VERSION="0.6.1"
docs::eval "$@"
main "$@"

0 comments on commit d517fa6

Please sign in to comment.