KILL(1,C) AIX Commands Reference KILL(1,C)
-------------------------------------------------------------------------------
kill
PURPOSE
Sends a signal to a running process.
SYNTAX
+------------+
kill ---| |--- process-ID ---|
+- - signal -+ ^ |
+--------------+
kill --- -l ---|
DESCRIPTION
The kill command sends a signal to a running process. The default signal is
signal 15 (SOFTWARE TERMINATE). This default signal normally kills processes
that do not catch or ignore the signal. The process-ID (PID or process
identification number) is used to identify the process you want to send a
signal to. The shell reports the PID of each process that is running in the
background (unless you start more than one process in a pipeline, in which case
the shell reports the number of the last process). You can also use the ps
command to find the process ID number of commands.
A signal can be a symbolic name or a number. These symbolic names and numbers
are:
Symbolic
Name Number Description
HUP 1 Hangup
INT 2 Interrupt
QUIT 3 Quit
ILL 4 Illegal instruction
TRAP 5 Trace trap
ABRT 6 Abort process.
EMT 7 EMT instruction
FPE 8 Floating point exception
KILL 9 Kill
BUS 10 Bus error
SEGV 11 Segmentation violation
SYS 12 Bad parameter to system call
PIPE 13 Write on a pipe when there is no process to read it
ALRM 14 Alarm clock
TERM 15 Software termination signal (default)
Processed November 8, 1990 KILL(1,C) 1
KILL(1,C) AIX Commands Reference KILL(1,C)
Symbolic
Name Number Description
URG 16 Urgent condition on I/O channel
STOP 17 Stop
TSTP 18 Interactive stop
CONT 19 Continue if stopped
CHLD 20 To parent on child stop or exit
TTIN 21 Background read attempted from control terminal
TTOU 22 Background write attempted to control terminal
IO 23 Input/output possible or completed
XCPU 24 CPU time limit exceeded
XFSZ 25 File size limit exceeded
MSG 27 HFT input data pending
WINCH 28 Window size change
PWR 29 Power failure imminent
USR1 30 User-defined signal 1
USR2 31 User-defined signal 2
PROF 32 Profiling time alarm
DANGER 33 System crash imminent
VTALRM 34 Virtual time alarm
MIGRATE 35 Migrate processes to signal sender's site
PRE 36 Programming exception
GRANT 60 HFT monitor mode granted
RETRACT 61 HFT monitor access should be relinquished
SOUND 62 An HFT sound control has completed execution
In addition, there are special process-IDs that cause the following special
actions:
0 The signal is sent to all processes having a process-group ID
equal to the process-group ID of the sender (except those with
PIDs 0 and 1).
-1 If the effective user ID of the sender is not 0 (root), signal
is sent to all processes with a real or effective user ID that
matches the real or effective user ID of the sender (except
those with PIDs 0 and 1).
If the effective user ID of the sender is 0 (root), signal is
sent to all processes, excluding numbers 0 and 1.
-process-ID The signal is sent to all processes whose process-group number
is equal to the absolute value of process-ID. When you specify
a minus PID, you must also specify the signal to be sent, even
signal 15.
See the kill system call in AIX Operating System Technical Reference for a
complete discussion of the kill command. For a complete discussion of the
signal numbers, see the sigaction system call in AIX Operating System Technical
Reference.
Processed November 8, 1990 KILL(1,C) 2
KILL(1,C) AIX Commands Reference KILL(1,C)
If you do not have superuser authority, the process you wish to stop must
belong to you. If you have superuser authority, you can kill any process.
FLAG
-l Lists the symbolic names of signals that may be specified instead of
signal numbers.
EXAMPLES
1. To stop a given process:
kill 1095
This command stops process "1095" by sending it the default signal, which
is signal 15 (also called TERM). Process "1095" might not actually stop if
it has made special arrangements to ignore or override signal 15.
2. To stop several processes that ignore the default signal:
kill -9 1034 1095
This command sends signal "9" (KILL) to processes "1034" and "1095".
Signal 9 is a special signal that normally cannot be ignored or overridden.
3. To stop all of your background processes:
kill 0
This command sends signal 15 to all members of the shell process group.
This includes all background processes started with "&". (See page
sh-2 about running background processes.) Although the signal is sent
to the shell, it has no effect because the shell ignores signal 15.
4. To stop all of your processes and log out:
kill -9 0
This command sends signal "9" to all members of the shell process group.
Because the shell cannot ignore signal 9, this command also stops the login
shell and logs you out. If you are using multiple windows on a
high-function terminal, this command closes the active window.
5. To kill all processes that you own:
kill -9 -1
This command sends signal "9" to all processes owned by the user, even
those started at other work stations and that belong to other process
groups. If you are using multiple windows on a high-function terminal,
this command closes all of the windows. If a listing that you requested is
being printed, it is also stopped.
Processed November 8, 1990 KILL(1,C) 3
KILL(1,C) AIX Commands Reference KILL(1,C)
Note: To send signal 15 with this form of the kill command, you must
specify "-15" explicitly:
kill -15 -1
6. To send a different signal code to a process:
kill -30 1103
This command sends signal "30" (USR1) to process "1103".
The name of the kill command is misleading because many signals, including
"16", do not stop processes. The action taken on signal "16" is defined by
the particular application you are running.
RELATED INFORMATION
See the following commands: "csh," "ps," and "sh, Rsh."
Note: The csh command contains a built-in subcommand named kill. The command
and subcommand do not always work the same way. For information on the
subcommand, see the csh command.
See the kill and sigaction system calls in AIX Operating System Technical
Reference.
Processed November 8, 1990 KILL(1,C) 4