File: killall.1

package info (click to toggle)
psmisc 22.21-2.1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 2,428 kB
  • ctags: 554
  • sloc: ansic: 4,810; sh: 4,674; makefile: 94; sed: 16
file content (173 lines) | stat: -rw-r--r-- 5,249 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
.\"
.\" Copyright 1993-2002 Werner Almesberger
.\"           2002-2012 Craig Small
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.TH KILLALL 1 "2012-7-28" "psmisc" "User Commands"
.SH NAME
killall \- kill processes by name
.SH SYNOPSIS
.ad l
.B killall
.RB [ \-Z , \ \-\-context
.IR pattern ]
.RB [ \-e , \ \-\-exact ]
.RB [ \-g , \ \-\-process\-group ]
.RB [ \-i , \ \-\-interactive ]
.RB [ \-o , \ \-\-older\-than
.IR TIME ]
.RB [ \-q , \ \-\-quiet ]
.RB [ \-r , \ \-\-regexp ]
.RB [ \-s , \ \-\-signal
.IR SIGNAL ,\  -SIGNAL ]
.RB [ \-u , \ \-\-user
.IR user ]
.RB [ \-v , \ \-\-verbose ]
.RB [ \-w , \ \-\-wait ]
.RB [ \-y , \ \-\-younger\-than
.IR TIME ]
.RB [ \-I , \ \-\-ignore-case ]
.RB [ \-V, \ \-\-version ]
.RB [ \-\- ]
.I name ...
.br
.B killall
.RB \-l
.br
.B killall
.RB \-V, \ \-\-version
.ad b
.SH DESCRIPTION
.B killall
sends a signal to all processes running any of the specified commands.
If no signal name is specified, SIGTERM is sent.
.PP
Signals can be specified either by name (e.g.
.B \-HUP
or
.BR -SIGHUP )
or by number (e.g.
.BR \-1 )
or by option
.BR -s .
.PP
If the command name is not regular expression (option
.BR -r )
and contains a slash
.RB ( / ),
processes executing that particular file will be selected for killing,
independent of their name.
.PP
.B killall
returns a zero return code if at least one process has been killed for
each listed command, or no commands were listed and at least one
process matched the -u and -Z search criteria.
.B killall
returns non-zero otherwise.
.PP
A
.B killall
process never kills itself (but may kill other
.B killall
processes).
.SH OPTIONS
.IP "\fB\-e\fP, \fB\-\-exact\fP"
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,
.B killall
will kill everything that matches within the first 15 characters.  With
.BR \-e ,
such entries are skipped.
.B killall
prints a message for each skipped entry
if
.B \-v
is specified in addition to
.BR \-e ,
.IP "\fB\-I\fP, \fB\-\-ignore\-case\fP"
Do case insensitive process name match.
.IP "\fB\-g\fP, \fB\-\-process\-group\fP"
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.
.IP "\fB\-i\fP, \fB\-\-interactive\fP"
Interactively ask for confirmation before killing.
.IP "\fB\-l\fP, \fB\-\-list\fP"
List all known signal names.
.IP "\fB\-o\fP, \fB\-\-older\-than\fP"
Match only processes that are older (started before) the time
specified.  The time is specified as a float then a unit.  The units
are s,m,h,d,w,M,y for seconds, minutes, hours, days, weeks, Months and
years respectively.
.IP "\fB\-q\fP, \fB\-\-quiet\fP"
Do not complain if no processes were killed.
.IP "\fB\-r\fP, \fB\-\-regexp\fP"
Interpret process name pattern as a POSIX extended regular expression, per
.BR regex (3).
.IP "\fB\-s\fP, \fB\-\-signal\fP, \fB\-SIGNAL\fP"
Send this signal instead of SIGTERM.
.IP "\fB\-u\fP, \fB\-\-user\fP"
Kill only processes the specified user owns.  Command names are
optional.
.IP "\fB\-v\fP, \fB\-\-verbose\fP"
Report if the signal was successfully sent.
.IP "\fB\-V\fP, \fB\-\-version\fP"
Display version information.
.IP "\fB\-w\fP, \fB\-\-wait\fP"
Wait for all killed processes to die.
.B killall
checks once per second if any of the killed processes still exist and
only returns if none are left.  Note that
.B killall
may wait forever if the signal was ignored, had no effect, or if the
process stays in zombie state.
.IP "\fB\-y\fP, \fB\-\-younger\-than\fP"
Match only processes that are younger (started after) the time
specified.  The time is specified as a float then a unit.  The units
are s,m,h,d,w,M,y for seconds, minutes, hours, days, weeks, Months and
years respectively.
.IP "\fB\-Z\fP, \fB\-\-context\fP"
(SELinux Only) Specify security context: kill only processes having
security context that match with given expended regular expression
pattern.  Must precede other arguments on the command line.  Command
names are optional.
.SH FILES
.TP
/proc
location of the proc file system
.SH "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.
.PP
Be warned that typing
.B killall
.I name
may not have the desired effect on non-Linux systems, especially when
done by a privileged user.
.PP
.B killall \-w
doesn't detect if a process disappears and is replaced by a new process
with the same PID between scans.
.PP
If processes change their name,
.B killall
may not be able to match them correctly.
.PP
.B killall
has a limit of names that can be specified on the command line.  This
figure is the size of an unsigned long multiplied by 8.  For most 32
bit systems the limit is 32 and similarly for a 64 bit system the limit
is usually 64.
.SH "SEE ALSO"
.BR kill (1),
.BR fuser (1),
.BR pgrep (1),
.BR pidof (1),
.BR pkill (1),
.BR ps (1),
.BR kill (2),
.BR regex (3).