systemctl
Processes and system
Usage
systemctl <verb> <unit>Starts, stops and inspects systemd services; `enable` only sets boot behaviour, so use `enable --now` to also start it, and run `daemon-reload` after editing a unit file.
Common flags
| Flag | Meaning |
|---|---|
| status <unit> | Whether it is running, its PID, and the last log lines. |
| start / stop / restart | Act on the service now, without changing boot behaviour. |
| reload | Re-read the config without dropping connections, if the service supports it. |
| enable --now <unit> | Start it now and also start it at every boot. |
| daemon-reload | Required after you edit a .service file, before restarting it. |
| list-units --failed | Everything that failed to start. |
| --user | Act on your own user units instead of the system ones. |
Examples
sudo systemctl restart nginxRestart the web server.
systemctl status sshd --no-pagerPrint the state and recent log lines without opening a pager.
sudo systemctl enable --now dockerStart Docker and make it come back after a reboot.
What is running and what is eating the machine. Identifying it comes before killing it.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does systemctl do?
Starts, stops and inspects systemd services; `enable` only sets boot behaviour, so use `enable --now` to also start it, and run `daemon-reload` after editing a unit file.
Q. How do I type it?
systemctl <verb> <unit> — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
7 are listed here; the full set is in man systemctl. This command sits under Processes and system.
Related commands
man page: man systemctl