forked from denisidoro/navi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request denisidoro#14 from 3duard0/cheats-systemctl
Cheatsheet for handling systemctl services.
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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$//' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters