How to use the systemctl command in Linux?

The systemctl command is a tool used to manage systemd services. Here is how to use the systemctl command:

  1. Start a service.
  2. Start the service using systemctl.
  3. Stop a service.
  4. Stop the service with the command systemctl stop .
  5. Restart a service.
  6. restart the service using systemctl
  7. Check the status of a service:
  8. Display the status of the service named using systemctl.
  9. Enable a service to start automatically when the system boots up.
  10. Enable a service using systemctl.
  11. Disable a service so it does not start automatically at system startup.
  12. Disable the service with the name specified in the command.
  13. View the configuration file of a service.
  14. Display the unit file for using systemctl.
  15. View all installed services:
  16. List all active unit files of type service using systemctl.
  17. View all running services.
  18. List all currently running services using systemctl.
  19. View the logs of the service:
  20. View system logs of the specified service using journalctl.

Here are some common usages of the systemctl command. For more options, you can refer to the manual page of systemctl by using the man systemctl command.

bannerAds