Shell脚本实现根据端口号kill相应进程功能

2019-09-23 09:32:01王旭

Linux根据占用的端口号来关闭相应的进程的shell脚本写法。
 

kill -9 $(lsof -i:22 |awk '{print $2}' | tail -n 2)