-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystemctl.cheat
40 lines (28 loc) · 1.52 KB
/
systemctl.cheat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
% systemctl, systemd
# Start user service
systemctl --user start <user_service_inactive>
# Stop user service
systemctl --user stop <user_service_active>
# Enable user service
systemctl --user enable <user_service_disabled>
# Disable user service
systemctl --user disable <user_service_enabled>
# Restart user service
systemctl --user restart <user_service>
# Reload user service
systemctl --user reload <user_service_active>
# User Service status
systemctl --user status <user_service>
# List running user services
systemctl --user list-units --type=service --state=running
# List enabled user services
systemctl --user list-unit-files --type=service --state=enabled
# List disabled user services
systemctl --user list-unit-files --type=service --state=disabled
# List available device unit files
systemctl list-units --all --full | grep ".device"
$ user_service_inactive: systemctl --user list-units --type=service --state=inactive | awk '{print $1}' | grep .service | sed 's/.service$//'
$ user_service_active: systemctl --user list-units --type=service --state=active | awk '{print $1}' | grep .service | sed 's/.service$//'
$ user_service_enabled: systemctl --user list-unit-files --type=service --state=enabled | awk '{print $1}' | grep .service | sed 's/.service$//'
$ user_service_disabled: systemctl --user list-unit-files --type=service --state=disabled | awk '{print $1}' | grep .service | sed 's/.service$//'
$ user_service: systemctl --user list-units --type=service --all | awk '{print $1}' | grep .service | sed 's/.service$//'