systemtl Command in Linux

Learn via video courses
Topics Covered

Overview

The systemctl command is a powerful tool in Linux that enables system administrators to manage system services and units. It is used to start, stop, restart, enable, disable, and reload services and daemons in the system. In this article, we will explore the syntax, options, and usage of the systemctl command.

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Linux systemctl Command Syntax

The syntax for the systemctl command is as follows:

Where:

  • OPTIONS: Optional arguments that modify the behavior of the command.
  • COMMAND: The action to be performed on the unit.
  • UNIT: The name of the unit to be acted upon.

systemctl Command Options:

  • -h, --help: Displays a help message and exits.
  • --version: Displays the version number of systemctl and exits.
  • -t, --type: Filters the list of units shown by type.
  • -a, --all: Shows all available units and their states.

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Example Usages

  • Start a Service::

    Explanation: This command starts the specified service.

  • Stop a Service::

    Explanation: This command stops the specified service.

  • Restart a Service::

    Explanation: This command restarts the specified service.

  • Enable a Service::

    Explanation: This command enables the specified service to start automatically on boot.

  • Disable a Service::

    Explanation: This command disables the specified service from starting automatically on boot.

  • Check the Status of a Service::

    Explanation: This command shows the status of the specified service.

Tips

  • You must have superuser privileges to run the systemctl command.

  • You can also use the systemctl command to reload a service without stopping it completely by using the 'reload' command.

Advanced Use Cases of systemctl Command in Linux

  • View All Running Services::

    Explanation: This command lists all currently running services on the system.

  • View Failed Services::

    Explanation: This command displays a list of all services that have failed.

  • Mask a Service::

    Explanation: This command masks the specified service, preventing it from being started manually or automatically.

Conclusion

  • The systemctl command is a powerful tool for managing services and units in Linux.

  • You can use it to start, stop, restart, enable, disable, and reload services and daemons in the system.

  • The systemctl command is essential for system administrators to manage their Linux systems effectively.