标签:nbsp dev RoCE ice pytho bsp nginx proc grep
批量根据服务名称查询进程id然后批量杀
sudo ps -ef|grep java | awk ‘{print $2}‘|sudo xargs kill -9
sudo ps -ef|grep python |awk ‘{print $2}‘|sudo xargs kill -9
sudo ps -ef|grep process |awk ‘{print $2}‘|sudo xargs kill -9
sudo ps -ef|grep redis |awk ‘{print $2}‘|sudo xargs kill -9
sudo ps -ef|grep storage-serv |awk ‘{print $2}‘|sudo xargs kill -9
sudo ps -ef|grep mysqld |awk ‘{print $2}‘|sudo xargs kill -9
sudo ps -ef|grep kube |awk ‘{print $2}‘|sudo xargs kill -9
根据port 查询服务进程/id:
[root@localhost sbin]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 8246 root 6u IPv4 64233 0t0 TCP *:http (LISTEN)
nginx 8247 nobody 6u IPv4 64233 0t0 TCP *:http (LISTEN)
也可以:
标签:nbsp dev RoCE ice pytho bsp nginx proc grep
原文地址:https://www.cnblogs.com/SunshineKimi/p/12146248.html