Compare commits

..

12 Commits

View File

@ -1,34 +1,34 @@
% systemctl
# Start service
systemctl start <service_inactive>
sudo systemctl start <service_inactive>
# Stop service
systemctl stop <service_active>
sudo systemctl stop <service_active>
# Enable service
systemctl enable <service_disabled>
sudo systemctl enable <service_disabled>
# Disable service
systemctl disable <service_enabled>
sudo systemctl disable <service_enabled>
# Restart service
systemctl restart <service>
sudo systemctl restart <service>
# Reload service
systemctl reload <service_active>
sudo systemctl reload <service_active>
# Service status
systemctl status <service>
sudo systemctl status <service>
# List running services
systemctl list-units --type=service --state=running
sudo systemctl list-units --type=service --state=running
# List enabled services
systemctl list-unit-files --type=service --state=enabled
sudo systemctl list-unit-files --type=service --state=enabled
# List disabled services
systemctl list-unit-files --type=service --state=disabled
sudo 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$//'