service
Run SysVinit scripts — legacy interface for starting and stopping services.
Synopsis
service SCRIPT COMMAND
Examples
sudo service nginx start
sudo service nginx restart
service --status-all
service nginx status
Common options
| Flag | Description |
|---|---|
| start | Start the service |
| stop | Stop the service |
| restart | Restart the service |
| status | Show service status |
| --status-all | Show status of all services |
About service
The `service` command run SysVinit scripts — legacy interface for starting and stopping services. Service and system commands manage daemons, scheduled tasks, system boot, and shutdown operations.
Modern Linux distributions use systemd for service management, though some still support SysVinit scripts. Understanding these commands is essential for deploying and maintaining production services.
The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man service`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Service & System Commands
Other commands in the Service & System category