kill 中文man頁面
NAME (名稱)
kill - 終止進程
SYNOPSIS(總覽)
kill[-ssignal|-p][-a]pid...
kill -l [ signal ]
DESCRIPTION (描述)
kill 給指定進程發(fā)送指定信號. 如果沒有指定信號, 則發(fā)送 TERM 信號. TERM 信號會殺死不能俘獲該信號的進程. 對于其他進程, 可能需要使用 KILL (9) 信號, 因為該信號不能夠被俘獲. 大多數現(xiàn)代的 shell 有一個內嵌的 kill 函數.
OPTIONS (選項)
- pid ...
- 給 kill 指定一個該發(fā)信號的進程列表. 每個 pid 可為下面四種之一. 進程名 在這種情況下,發(fā)信號給所命名的進程. n 這里的 n 大于 0. 將發(fā)信號給 pid 為 n 的進程. -1 在這種情況下, 只要發(fā)信號的用戶能夠控制那些進行, 將發(fā)信號給所有從 MAX_INT 到 2 的進程. -n 這里的 n 大于 1, 在這種情況下, 發(fā)信號給屬于進程組 n 的進程. 如果給定一個負的參數, 那么信號 必須 首先聲明, 否則它會被當作信號發(fā)送出去.
- -s
- 指定發(fā)送的信號. 信號可以以信號名或數字的方式給定.
- -p
- 指定 kill 只打印命名進程的進程標識 (pid) , 而不應發(fā)送給它信號.
- -l
- 打印信號名的列表.這可以在 /usr/include/linux/signal.h 中找到.
SEE ALSO (又見)
bash(1), tcsh(1), kill(2), sigvec(2)
#p#
NAME
kill - terminate a process
SYNOPSIS
kill [ -s signal | -p ] [ -a ] [ -- ] pid ...
kill -l [ signal ]
DESCRIPTION
The command kill sends the specified signal to the specified process or process group. If no signal is specified, the TERM signal is sent. The TERM signal will kill processes which do not catch this signal. For other processes, it may be necessary to use the KILL (9) signal, since this signal cannot be caught.
Most modern shells have a builtin kill function, with a usage rather similar to that of the command described here. The `-a' and `-p' options, and the possibility to specify pids by command name is a local extension.
OPTIONS
- pid...
- Specify the list of processes that kill should signal. Each pid can be one of five things:
- n
- where n is larger than 0. The process with pid n will be signaled.
- 0
- All processes in the current process group are signaled.
- -1
- All processes with pid larger than 1 will be signaled.
- -n
- where n is larger than 1. All processes in process group n are signaled. When an argument of the form `-n' is given, and it is meant to denote a process group, either the signal must be specified first, or the argument must be preceded by a `--' option, otherwise it will be taken as the signal to send.
- commandname
- All processes invoked using that name will be signaled.
- -s signal
- Specify the signal to send. The signal may be given as a signal name or number.
- -l
- Print a list of signal names. These are found in /usr/include/linux/signal.h
- -a
- Do not restrict the commandname-to-pid conversion to processes with the same uid as the present process.
- -p
- Specify that kill should only print the process id (pid) of the named processes, and not send any signals.
SEE ALSO
bash(1), tcsh(1), kill(2), sigvec(2), signal(7)