KILL(1) Linux Programmer’s Manual KILL(1)
名前
kill - プロセスを終了させる
書式
kill [ -s signal | -p ] [ -a ] [ -- ] pid ...
kill -l [ signal ]
説明
kill コマンドは、指定したシグナルを指定したプロセスまたはプロセスグルー
プへ送る。シグナルが指定されない場合、TERMシグナルを送る。 TERMシグナル
は 、このシグナルをキャッチしないプロセスを終了させる。このシグナルをキ
ャッチしてしまうプロセスを終了させるためには、 KILL (9) シグナルを使 う
必要がある。
最 近のシェルのほとんどには、組み込みのkill機能があり、ここで説明してい
るコマンドと同じような使い方をする。 ‘-a’ オプションと ‘-p’ オプショ ン
、そしてコマンド名で PID を指定する方法はローカルな拡張である。
オプション
pid... kill がシグナルを送るプロセスのリストを指定する。それぞれの pid
に対して、指定方法は次の 5 通り。
n >0の場合は、pid n のプロセスへシグナルを送る。
0 現在のプロセスグループの全てのプロセスにシグナルを送る。
-1 PID が 1 より大きい全てのプロセスにシグナルを送る。
-n -n (n>1)の場合は、プロセスグループ n に属する全プロセスへ
シ グナルを送る。 ‘-n’ の形の引数を場合は、シグナルを最初
に指定するか、もしくは引数を ‘--’ オプションの後に指定 し
な ければならない。そうしないと、シグナルの指定として解釈
されてしまう。
commandname
この名前で起動された全てのプロセスにシグナルを送る。
-s signal
送るシグナルを指定する。シグナルは名前か、または番号で指定する。
-l シグナル名のリストを表示する。 /usr/include/linux/signal.h の中
で定義されている。
-a デフォルトでは、コマンド名から PID への変換は現在のプロセスと 同
じ UID を持つものに制限されているが、その制限を外す。
-p kill に、指定したプロセスのプロセスID (pid) の表示のみをさせる。
何のシグナルも送らない。
関連項目
bash(1), tcsh(1), kill(2), sigvec(2), signal(7)
著者
BSD 4.4から入手。 Salvatore Valente
KILL(1) Linux Programmer’s Manual KILL(1)
NAME
kill - terminate a process
SYNOPSIS
kill [-s signal|-p] [--] 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.
If sig is 0, then no signal is sent, but error checking is still per-
formed.
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.
NOTES
It is not possible to send a signal to explicitly selected thread in a
multithreaded process by kill(2) syscall. If kill(2) is used to send a
signal to a thread group, then kernel selects arbitrary member of the
thread group that has not blocked the signal. For more details see
clone(2) CLONE_THREAD description.
The command kill(1) as well as syscall kill(2) accepts TID (thread ID,
see gettid(2)) as argument. In this case the kill behavior is not
changed and the signal is also delivered to the thread group rather
than to the specified thread.
SEE ALSO
bash(1), tcsh(1), kill(2), sigvec(2), signal(7)
AUTHOR
Taken from BSD 4.4. The ability to translate process names to process
ids was added by Salvatore Valente
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa