Skip to content

Instantly share code, notes, and snippets.

@2arunpmohan
Created December 13, 2019 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2arunpmohan/1ed131819c3e1203b8c979a5c022ba03 to your computer and use it in GitHub Desktop.
Save 2arunpmohan/1ed131819c3e1203b8c979a5c022ba03 to your computer and use it in GitHub Desktop.
**1. start a service**
`sudo systemctl start nginx.service`
**2. Stop a service**
`sudo systemctl stop nginx.service`
**3.Restart a service**
`sudo systemctl restart nginx.service`
**4.Reload a service**
without interrupting the normal functionality
`sudo systemctl reload nginx.service`
**5. Enable a service at bootup**
`sudo systemctl enable nginx.service`
**6. Disable a service at bootup**
`sudo systemctl disable nginx.service`
**7. To get all of the unit files that systemd has listed as “active”**
`systemctl list-units`
**8. To list all of the units that systemd has loaded or attempted to load into memory, including those that are not currently active**
`systemctl list-units --all`
**9. To list all of the units installed on the system, including those that systemd has not tried to load into memory**
`systemctl list-unit-files`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment