Linux 杀死所有进程

方法一:

sudo killall -9 netease-cloud-music

这种方法,必须要写全称。

sudo netease-cloud-music 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
05-23, 14:29:48 [Error  ] [                          0] Media changed
05-23, 14:29:48 [Error  ] [                          0] Player opening
已杀死

方法二:

sudo kill -9 `pgrep netease`

这种方法,只需要知道大概的名称即可。

sudo netease-cloud-music 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
05-23, 14:31:53 [Error  ] [                          0] Media changed
05-23, 14:31:53 [Error  ] [                          0] Player opening
已杀死

方法三:

sudo pkill -9 netease-cloud

这个是方法二的延伸版本

sudo netease-cloud-music 
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
05-23, 14:33:32 [Error  ] [                          0] Media changed
05-23, 14:33:32 [Error  ] [                          0] Player opening
已杀死

方法四:

# ps -aux | grep netease | awk '{print $2}'
11270
11271
11273
11309
11416
sudo kill -s 9 `ps -aux | grep netease | awk '{print $2}'`

这个应该是最原始的思路了。

猜你喜欢

转载自www.cnblogs.com/jiqing9006/p/9076824.html
今日推荐