我正在编写bash文件(.command @OS ),以方便地更新远程服务器(Linux)上的程序。我被困在想杀哪一个PID的时候了。我有相同名称的不同进程,即 mono ,因为它们是由mono执行的。
使用pgrep ,我可以使用mono获得所有的PID,但是,我只想杀死命令行SCREEN -dmSL steambot SteamBot.exe的进程。
我怎么知道要杀什么PID?自动取款机,我的.command文件看起来如下:
ssh xxx@xxxx.com
pgrep mono我也使用ssh-keychain登录。
发布于 2016-05-19 20:32:34
就像这样:
ps -ef | grep '[S]CREEN -dmSL steambot mono SteamBot\.exe' |
awk '{print $2}' | xargs -r killhttps://stackoverflow.com/questions/37333372
复制相似问题