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}'`

這個應該是最原始的思路了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM