Cheat Sheet #day65 - service

service Command Cheatsheet
The service command in Unix-like systems is used to control services (daemons) that run in the background. It allows starting, stopping, restarting, and managing services with ease. Here’s a quick reference guide:
Basic Syntax
service SERVICE_NAME {start|stop|restart|status}
Common Options
Start a service:
service apache2 startStop a service:
service apache2 stopRestart a service:
service apache2 restartCheck status of a service:
service apache2 statusReload configuration of a service without restarting:
service apache2 reload
Examples
Start the Apache HTTP server:
service apache2 startStop the Apache HTTP server:
service apache2 stopRestart the Apache HTTP server:
service apache2 restartCheck the status of the Apache HTTP server:
service apache2 statusReload the configuration of the Apache HTTP server:
service apache2 reload
Additional Information
Help option:
service --helpView manual page for
service:man service
The service command simplifies the management of services on Unix-like systems, providing a straightforward way to start, stop, restart, and check the status of services. For more detailed information and additional options, refer to the man page or use service --help.




