Ubuntu killall 命令詳解

"killall" 用於按名稱殺死指定進程 (kill processes by name)。

以前,若要找到殺死進程,需使用 "ps" 命令配閤 "grep" 查找進程,而 "killall" 卻把這 2 個過程閤二為一瞭。

譬如:killall memcached


killall [OPTION]... [--] NAME...

killall -l, --list

killall -V, --version

Option 參數

# 參數 EN 解釋 中文翻譯 備注
01 -e,--exact require exact match for very long names
02 -I,--ignore-case case insensitive process name match
03 -g,--process-group kill process group instead of process
04 -y,--younger-than kill processes younger than TIME
05 -o,--older-than kill processes older than TIME
06 -i,--interactive ask for confirmation before killing
07 -l,--list list all known signal names
08 -q,--quiet don't print complaints
09 -r,--regexp interpret NAME as an extended regular expression
10 -s,--signal SIGNAL send this signal instead of SIGTERM
11 -u,--user USER kill only process(es) running as USER
12 -v,--verbose report if the signal was successfully sent
13 -V,--version display version information
14 -w,--wait wait for processes to die


功能 # 命令規範 文字解釋 示例 示例解釋
殺死進程 01 killall <command-name> 殺死指定名稱進程 killall memcached 殺死 memcached 進程
查看幫助 01 killall --help 查看 killall 幫助信息
查看版本 01 killall --version 查看 killall 版本信息