Skip to main content

Command referencesystemctl

systemctl command (Linux / bash / sh / zsh)

Linuxbashshzshsystemintermediate

What it does

Control and inspect services and other systemd units. When people search for the systemctl command linux services, they usually want systemctl's everyday flags, safe examples, and how it differs from related tools. Below you'll find syntax, options, and copyable examples for Bash/sh/zsh.

Control and inspect services and other systemd units.

Syntax

systemctl [OPTION]... COMMAND [UNIT...]

Common options

Flag / optionMeaning
status UNITShow current unit state and recent logs.
start UNITStart a unit now.
enable UNITConfigure a unit to start at boot.
restart UNITStop and start a unit.
--userOperate on the calling user's service manager.

Practical examples

Inspect service

systemctl status nginx.service

Shows nginx state and diagnostics.

Enable and start

sudo systemctl enable --now nginx

Starts nginx and enables boot startup.

Reload units

sudo systemctl daemon-reload

Reloads unit definitions after edits.

Linux ↔ Windows equivalent

Closest match: Get-Service (Windows / PowerShell). Retrieve service controller objects and current service states.

Common mistakes

  • Assuming `enable` also starts a service unless `--now` is supplied.
  • Forgetting daemon-reload after changing a unit file.

FAQ

What does systemctl do in Linux?

Control and inspect services and other systemd units.

How do I use systemctl from the terminal?

Start with `systemctl [OPTION]... COMMAND [UNIT...]`, then choose only the options needed for the task.

What is a practical systemctl example?

Try `systemctl status nginx.service` — Shows nginx state and diagnostics.

Can I use systemctl in a shell script?

Yes. systemctl works in Bash, sh, and Zsh, but scripts should handle quoting, errors, and command output explicitly.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.