Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

kill

Synopsis

kill [options] [pids]

Send a signal to terminate one or more process IDs. You must own the process or be a privileged user. If no signal is specified, TERM is sent.

This entry describes the /bin/kill command. There are also built-in shell commands of the same name; the bash version is described in Chapter 6.

In some Linux distributions, /bin/kill allows you to specify a command name, such as gcc or xpdf, instead of a process ID (PID). All processes running that command with the same UID as the process issuing /bin/kill are sent the signal.

If /bin/kill is issued with a pid of 0, it sends the signal to all processes of its own process group. If /bin/kill is issued with a pid of −1, it sends the signal to all processes except process 1 (the system’s init process).

Options

-a

Kill all processes of the given name (if privileges allow), not just processes with the same UID. To use this option, specify the full path (e.g., /bin/kill -a gcc).

-l

List all signals.

-p

Print the process ID of the named process, but don’t send it a signal. To use this option, specify the full path (e.g., /bin/kill -p).

-s SIGNAL, -SIGNAL

The signal number (from /usr/include/sys/signal.h) or name (from kill -l). With a signal number of 9 (KILL), the kill cannot be caught by the process; use this to kill a process that a plain kill doesn’t terminate. The default signal is TERM. The letter flag itself is optional: both kill −9 1024 and kill -s 9 1024 terminate process 1024.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page