阅读量:134
在Linux中,可以使用以下命令停止一个正在运行的服务:
-
使用
systemctl命令:- 查找正在运行的服务:
systemctl list-units --type=service --state=running - 停止服务:
sudo systemctl stop
- 查找正在运行的服务:
-
使用
service命令:- 查找正在运行的服务:
service --status-all - 停止服务:
sudo servicestop
- 查找正在运行的服务:
-
使用
kill命令:- 查找正在运行的服务的进程ID(PID):
ps -ef | grep - 停止服务:
sudo kill
- 查找正在运行的服务的进程ID(PID):
请替换为你要停止的服务的名称。