Skip to content

Instantly share code, notes, and snippets.

@vicente-gonzalez-ruiz
Last active March 27, 2020 13:20
Show Gist options
  • Save vicente-gonzalez-ruiz/ae89c13f652193c857f3206f715ffcbf to your computer and use it in GitHub Desktop.
Save vicente-gonzalez-ruiz/ae89c13f652193c857f3206f715ffcbf to your computer and use it in GitHub Desktop.
How to get the status, enable and disable a service in Linux
# See: https://wiki.archlinux.org/index.php/systemd
# List running services:
systemctl list-units
systemctl list-units | grep service
# List all available services (running or not):
systemctl list-unit-files
# Start a service (sshd, for example):
sudo systemctl start sshd.service
# Stop a service (sshd, for example):
sudo systemctl stop sshd.service
# Disable a service (lightdm, for example):
sudo systemctl disable lightdm.service
# Enable a service (lightdm, for example):
sudo systemctl disable lightdm.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment