killall 中文man頁面
NAME (名稱)
killall - 以名字方式來殺死進程
SYNOPSIS (總覽)
killall [-egiqvw] [-signal] name ...
killall -l
killall -V
DESCRIPTION (描述)
killall 發(fā)送一條信號給所有運行任意指定命令的進程. 如果沒有指定信號名, 則發(fā)送 SIGTERM.
信號可以以名字 (如 -HUP ) 或者數(shù)字 (如 -1 ) 的方式指定. 信號 0 (檢查進程是否存在)只能以數(shù)字方式指定.
如果命令名包括斜杠 (/), 那么執(zhí)行該特定文件的進程將被殺掉, 這與進程名無關(guān).
如果對于所列命令無進程可殺, 那么 killall 會返回非零值. 如果對于每條命令至少殺死了一個進程, killall 返回 0.
killall 進程決不會殺死自己 (但是可以殺死其它 killall 進程).
OPTIONS (選項)
- -e
- 對于很長的名字, 要求準確匹配. 如果一個命令名長于 15 個字符, 則可能不能用整個名字 (溢出了). 在這種情況下, killall 會殺死所有匹配名字前 15 個字符的所有進程. 有了 -e 選項,這樣的記錄將忽略. 如果同時指定了 -v 選項, killall 會針對每個忽略的記錄打印一條消息.
- -g
- 殺死屬于該進程組的進程. kill 信號給每個組只發(fā)送一次, 即使同一進程組中包含多個進程.
- -i
- 交互方式,在殺死進程之前征求確認信息.
- -l
- 列出所有已知的信號名.
- -q
- 如果沒有進程殺死, 不會提出抱怨.
- -v
- 報告信號是否成功發(fā)送.
- -V
- 顯示版本信息.
- -w
- 等待所有殺的進程死去. killall 會每秒檢查一次是否任何被殺的進程仍然存在, 僅當都死光后才返回. 注意: 如果信號被忽略或沒有起作用, 或者進程停留在僵尸狀態(tài), killall 可能會***等待.
FILES(相關(guān)文件)
/proc proc文件系統(tǒng)的存在位置
KNOWN BUGS (已知 BUGS)
以文件方式殺死只對那些在執(zhí)行時一直打開的可執(zhí)行文件起作用, 也即, 混雜的可執(zhí)行文件不能夠通過這種方式殺死.
要警告的是輸入 killall name 可能不會在非 Linux 系統(tǒng)上產(chǎn)生預(yù)期的效果, 特別是特權(quán)用戶執(zhí)行時要小心.
在兩次掃描的間隙, 如果進程消失了而被代之以一個有同樣 PID 的新進程, killall -w 偵測不到.
AUTHOR (作者)
Werner Almesberger <Werner.Almesberger@epfl.ch>
SEE ALSO (又見)
kill(1), fuser(1), pidof(1), ps(1), kill(2)
#p#
NAME
killall - kill processes by name
SYNOPSIS
killall [-c,--context] [-e,--exact] [-g,--process-group] [-i,--interactive] [-q,--quiet] [-s,--signal signal] [-v,--verbose] [-w,--wait] [-V,--version] [--] name ...
killall -l
killall -V,--version
DESCRIPTION
killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.
Signals can be specified either by name (e.g. -HUP) or by number (e.g. -1).
If the command name contains a slash (/), processes executing that particular file will be selected for killing, independent of their name.
killall returns a zero return code if at least one process has been killed for each listed command. killall returns non-zero otherwise.
A killall process never kills itself (but may kill other killall processes).
OPTIONS
- -e, --exact
- Require an exact match for very long names. If a command name is longer than 15 characters, the full name may be unavailable (i.e. it is swapped out). In this case, killall will kill everything that matches within the first 15 characters. With -e, such entries are skipped. killall prints a message for each skipped entry if -v is specified in addition to -e,
- -g, --process-group
- Kill the process group to which the process belongs. The kill signal is only sent once per group, even if multiple processes belonging to the same process group were found.
- -i, --interactive
- Interactively ask for confirmation before killing.
- -l, --list
- List all known signal names.
- -q, --quiet
- Do not complain if no processes were killed.
- -v, --verbose
- Report if the signal was successfully sent.
- -V, --version
- Display version information.
- -w, --wait
- Wait for all killed processes to die. killall checks once per second if any of the killed processes still exist and only returns if none are left. Note that killall may wait forever if the signal was ignored, had no effect, or if the process stays in zombie state.
- -Z
- (SELinux Only) Specify security context: kill only processes with given security context. Must precede other arguments on the command line.
FILES
/proc location of the proc file system
KNOWN BUGS
Killing by file only works for executables that are kept open during execution, i.e. impure executables can't be killed this way.
Be warned that typing killall name may not have the desired effect on non-Linux systems, especially when done by a privileged user.
killall -w doesn't detect if a process disappears and is replaced by a new process with the same PID between scans.
AUTHORS
Werner Almesberger <werner@almesberger.net> wrote the original version of psmisc. Since version 20 Craig Small <csmall@small.dropbear.id.au> can be blamed.
SEE ALSO
kill(1),fuser(1),pgrep(1),pidof(1),pkill(1),ps(1),kill(2)