Back to the command reference

service

SystemFundamentalsReference only

Run a service init script (older style)

Name: service

This command is outside what the site lets you practise (mostly distribution-specific or rarely used tools). This page describes how to use it; try it on your own Linux system.

Description

service is the older tool for managing services by running scripts in /etc/init.d/. On systemd systems it forwards requests to systemctl, so both work.

Syntax

service NAME COMMAND

Common options

start / stop / restart / statusCommon actions
--status-allList every service and whether it runs

Examples

  • $ sudo service nginx restart

    Restart nginx

    Explain
  • $ service --status-all

    Status of every service

    Explain

Related