killall 中文man页面

系统
killall 发送一条信号给所有运行任意指定命令的进程. 如果没有指定信号名, 则发送 SIGTERM.

NAME (名称)

killall - 以名字方式来杀死进程  

SYNOPSIS (总览)

killall [-egiqvw] [-signal] name ...
killall -l
killall -V  

DESCRIPTION (描述)

killall 发送一条信号给所有运行任意指定命令的进程. 如果没有指定信号名, 则发送 SIGTERM.

信号可以以名字 (如 -HUP ) 或者数字 (如 -1 ) 的方式指定. 信号 0 (检查进程是否存在)只能以数字方式指定.

如果命令名包括斜杠 (/), 那么执行该特定文件的进程将被杀掉, 这与进程名无关.

如果对于所列命令无进程可杀, 那么 killall 会返回非零值. 如果对于每条命令至少杀死了一个进程, killall 返回 0.

killall 进程决不会杀死自己 (但是可以杀死其它 killall 进程).  

OPTIONS (选项)

-e
对于很长的名字, 要求准确匹配. 如果一个命令名长于 15 个字符, 则可能不能用整个名字 (溢出了). 在这种情况下, killall 会杀死所有匹配名字前 15 个字符的所有进程. 有了 -e 选项,这样的记录将忽略. 如果同时指定了 -v 选项, killall 会针对每个忽略的记录打印一条消息.
-g
杀死属于该进程组的进程. kill 信号给每个组只发送一次, 即使同一进程组中包含多个进程.
-i
交互方式,在杀死进程之前征求确认信息.
-l
列出所有已知的信号名.
-q
如果没有进程杀死, 不会提出抱怨.
-v
报告信号是否成功发送.
-V
显示版本信息.
-w
等待所有杀的进程死去. killall 会每秒检查一次是否任何被杀的进程仍然存在, 仅当都死光后才返回. 注意: 如果信号被忽略或没有起作用, 或者进程停留在僵尸状态, killall 可能会***等待.

FILES(相关文件)

/proc   proc文件系统的存在位置

KNOWN BUGS (已知 BUGS)

以文件方式杀死只对那些在执行时一直打开的可执行文件起作用, 也即, 混杂的可执行文件不能够通过这种方式杀死.

要警告的是输入 killall name 可能不会在非 Linux 系统上产生预期的效果, 特别是特权用户执行时要小心.

在两次扫描的间隙, 如果进程消失了而被代之以一个有同样 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)

责任编辑:韩亚珊 来源: 互联网
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-16 10:59:16

pwconv中文man

2011-08-18 19:02:43

environ中文man

2011-08-25 17:43:07

snprintf中文man

2011-08-19 18:30:52

ipc中文man

2011-08-24 15:35:52

hier中文man

2011-08-25 17:18:07

putc中文man

2011-08-15 13:53:19

stat中文man

2011-08-16 10:10:58

setup中文man

2011-08-25 15:24:31

execlp中文man

2011-08-25 18:24:12

termios中文man

2011-08-15 18:06:07

restore中文man

2011-08-24 17:26:35

reindex中文man

2011-08-25 16:55:26

gets中文man

2011-08-15 15:45:04

xpdf中文man

2011-08-24 17:06:42

NOTIFY中文man
点赞
收藏

51CTO技术栈公众号