The command to stop the service in Linux is "stop". The stop command can stop the service specified in Linux, and the service will not take effect after restarting. The syntax is "[service name] stop".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
What is the command to stop the service in Linux
The command to stop the service in Linux is "stop".
The commands to start, restart, and stop services are: start, restart, and stop. The command format is as follows:
[服务名] start [服务名] restart [服务名] stop
Various service scripts are stored in /etc/init.d (or / etc/rc.d/init.d) directory, take the network service network as an example:
Start the network service: /etc/init.d/network start
Restart the network service: / etc/init.d/network restart
Stop the network service:/etc/init.d/network stop
In addition, these service scripts generally also provide the status display command status; or you can do it yourself Add your own commands to these scripts and implement some enhanced functions by executing "[service name] [own command]".
Examples are as follows:
Stop ssh service
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What is the command to stop a service in Linux?. For more information, please follow other related articles on the PHP Chinese website!