From 2352c2f83a48aefa67cf27bb1ef440a033803e34 Mon Sep 17 00:00:00 2001 From: Eduardo Seabra Date: Sat, 21 Sep 2019 10:24:38 -0300 Subject: [PATCH] Add cheats: systemctl --- cheats/systemctl.cheat | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cheats/systemctl.cheat diff --git a/cheats/systemctl.cheat b/cheats/systemctl.cheat new file mode 100644 index 0000000..8319da5 --- /dev/null +++ b/cheats/systemctl.cheat @@ -0,0 +1,37 @@ +% systemctl, service + +# Start service +systemctl start + +# Stop service +systemctl stop + +# Enable service +systemctl enable + +# Disable service +systemctl disable + +# Restart service +systemctl restart + +# Reload service +systemctl reload + +# Service status +systemctl status + +# 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$//'