Home·Terminal commands

service

Processes and system

Usage

service <name> <start|stop|restart|status>

A thin wrapper left over from the SysV era; on a systemd machine it simply forwards to systemctl and understands fewer verbs.

Common flags

FlagMeaning
start / stop / restartThe three verbs that work everywhere.
statusAsk the service how it is doing.
--status-allList every init script and its state (Debian/Ubuntu).

Examples

sudo service nginx restart

Restart a service on a machine of any vintage.

service --status-all

See every service the old init system knows about.

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 service do?

A thin wrapper left over from the SysV era; on a systemd machine it simply forwards to systemctl and understands fewer verbs.

Q. How do I type it?

service <name> <start|stop|restart|status> — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

3 are listed here; the full set is in man service. This command sits under Processes and system.

Related commands

man page: man service