| 1 |
.\" Manual page for splashy_pgrep / splashy_pkill.
|
| 2 |
.\" Licensed under version 2 of the GNU General Public License.
|
| 3 |
.\" Copyright 2000 Kjetil Torgrim Homme
|
| 4 |
.\"
|
| 5 |
.TH SPLASHY_PGREP 1 "June 25, 2000" "Linux" "Linux User's Manual"
|
| 6 |
.SH NAME
|
| 7 |
splashy_pgrep, splashy_pkill \- look up or signal processes based on name and other attributes
|
| 8 |
|
| 9 |
.SH SYNOPSIS
|
| 10 |
splashy_pgrep [\-flvx] [\-d \fIdelimiter\fP] [\-n|\-o] [\-P \fIppid\fP,...] [\-g \fIpgrp\fP,...]
|
| 11 |
.br
|
| 12 |
[\-s \fIsid\fP,...] [\-u \fIeuid\fP,...] [\-U \fIuid\fP,...] [\-G \fIgid\fP,...]
|
| 13 |
.br
|
| 14 |
[\-t \fIterm\fP,...] [\fIpattern\fP]
|
| 15 |
|
| 16 |
splashy_pkill [\-\fIsignal\fP] [\-fvx] [\-n|\-o] [\-P \fIppid\fP,...] [\-g \fIpgrp\fP,...]
|
| 17 |
.br
|
| 18 |
[\-s \fIsid\fP,...] [\-u \fIeuid\fP,...] [\-U \fIuid\fP,...] [\-G \fIgid\fP,...]
|
| 19 |
.br
|
| 20 |
[\-t \fIterm\fP,...] [\fIpattern\fP]
|
| 21 |
|
| 22 |
.SH DESCRIPTION
|
| 23 |
\fBsplashy_pgrep\fP looks through the currently running processes and lists the
|
| 24 |
process IDs which matches the selection criteria to stdout. All
|
| 25 |
the criteria have to match. For example,
|
| 26 |
|
| 27 |
splashy_pgrep -u root sshd
|
| 28 |
|
| 29 |
will only list the processes called \fBsshd\fP AND owned by \fBroot\fP.
|
| 30 |
On the other hand,
|
| 31 |
|
| 32 |
splashy_pgrep -u root,daemon
|
| 33 |
|
| 34 |
will list the processes owned by \fBroot\fP OR \fBdaemon\fP.
|
| 35 |
|
| 36 |
\fBsplashy_pkill\fP will send the specified signal (by default \fBSIGTERM\fP)
|
| 37 |
to each process instead of listing them on stdout.
|
| 38 |
|
| 39 |
.SH OPTIONS
|
| 40 |
.TP
|
| 41 |
\-c
|
| 42 |
Suppress normal output; instead print a count of matching processes.
|
| 43 |
.TP
|
| 44 |
\-d \fIdelimiter\fP
|
| 45 |
Sets the string used to delimit each process ID in the output (by
|
| 46 |
default a newline). (\fBsplashy_pgrep\fP only.)
|
| 47 |
.TP
|
| 48 |
\-f
|
| 49 |
The \fIpattern\fP is normally only matched against the process name.
|
| 50 |
When \-f is set, the full command line is used.
|
| 51 |
.TP
|
| 52 |
\-g \fIpgrp\fP,...
|
| 53 |
Only match processes in the process group IDs listed. Process group 0
|
| 54 |
is translated into \fBsplashy_pgrep\fP's or \fBsplashy_pkill\fP's own process group.
|
| 55 |
.TP
|
| 56 |
\-G \fIgid\fP,...
|
| 57 |
Only match processes whose real group ID is listed. Either the
|
| 58 |
numerical or symbolical value may be used.
|
| 59 |
.TP
|
| 60 |
\-l
|
| 61 |
List the process name as well as the process ID. (\fBsplashy_pgrep\fP only.)
|
| 62 |
.TP
|
| 63 |
\-n
|
| 64 |
Select only the newest (most recently started) of the matching
|
| 65 |
processes.
|
| 66 |
.TP
|
| 67 |
\-o
|
| 68 |
Select only the oldest (least recently started) of the matching
|
| 69 |
processes.
|
| 70 |
.TP
|
| 71 |
\-P \fIppid\fP,...
|
| 72 |
Only match processes whose parent process ID is listed.
|
| 73 |
.TP
|
| 74 |
\-s \fIsid\fP,...
|
| 75 |
Only match processes whose process session ID is listed. Session ID 0
|
| 76 |
is translated into \fBsplashy_pgrep\fP's or \fBsplashy_pkill\fP's own session ID.
|
| 77 |
.TP
|
| 78 |
\-t \fIterm\fP,...
|
| 79 |
Only match processes whose controlling terminal is listed. The
|
| 80 |
terminal name should be specified without the "/dev/" prefix.
|
| 81 |
.TP
|
| 82 |
\-u \fIeuid\fP,...
|
| 83 |
Only match processes whose effective user ID is listed. Either the
|
| 84 |
numerical or symbolical value may be used.
|
| 85 |
.TP
|
| 86 |
\-U \fIuid\fP,...
|
| 87 |
Only match processes whose real user ID is listed. Either the
|
| 88 |
numerical or symbolical value may be used.
|
| 89 |
.TP
|
| 90 |
\-v
|
| 91 |
Negates the matching.
|
| 92 |
.TP
|
| 93 |
\-x
|
| 94 |
Only match processes whose name (or command line if \-f is specified)
|
| 95 |
\fBexactly\fP match the \fIpattern\fP.
|
| 96 |
.TP
|
| 97 |
\-\fIsignal\fP
|
| 98 |
Defines the signal to send to each matched process. Either the
|
| 99 |
numeric or the symbolic signal name can be used. (\fBsplashy_pkill\fP only.)
|
| 100 |
|
| 101 |
.SH OPERANDS
|
| 102 |
.TP
|
| 103 |
\fIpattern\fP
|
| 104 |
Specifies an Extended Regular Expression for matching against the
|
| 105 |
process names or command lines.
|
| 106 |
|
| 107 |
.SH EXAMPLES
|
| 108 |
Example 1: Find the process ID of the \fBnamed\fP daemon:
|
| 109 |
|
| 110 |
unix$ splashy_pgrep \-u root named
|
| 111 |
|
| 112 |
Example 2: Make \fBsyslog\fP reread its configuration file:
|
| 113 |
|
| 114 |
unix$ splashy_pkill \-HUP syslogd
|
| 115 |
|
| 116 |
Example 3: Give detailed information on all \fBxterm\fP processes:
|
| 117 |
|
| 118 |
unix$ ps \-fp $(splashy_pgrep \-d, \-x xterm)
|
| 119 |
|
| 120 |
Example 4: Make all \fBnetscape\fP processes run nicer:
|
| 121 |
|
| 122 |
unix$ renice +4 `splashy_pgrep netscape`
|
| 123 |
|
| 124 |
.SH "EXIT STATUS"
|
| 125 |
.TP
|
| 126 |
.I "0"
|
| 127 |
One or more processes matched the criteria.
|
| 128 |
.TP
|
| 129 |
.I "1"
|
| 130 |
No processes matched.
|
| 131 |
.TP
|
| 132 |
.I "2"
|
| 133 |
Syntax error in the command line.
|
| 134 |
.TP
|
| 135 |
.I "3"
|
| 136 |
Fatal error: out of memory etc.
|
| 137 |
|
| 138 |
.SH NOTES
|
| 139 |
The process name used for matching is limited to the 15 characters
|
| 140 |
present in the output of /proc/\fIpid\fP/stat. Use the \-f option to
|
| 141 |
match against the complete command line, /proc/\fIpid\fP/cmdline.
|
| 142 |
|
| 143 |
The running \fBsplashy_pgrep\fP or \fBsplashy_pkill\fP process will never report
|
| 144 |
itself as a match.
|
| 145 |
|
| 146 |
.SH BUGS
|
| 147 |
The options \-n and \-o and \-v can not be combined. Let me know if
|
| 148 |
you need to do this.
|
| 149 |
|
| 150 |
Defunct processes are reported.
|
| 151 |
|
| 152 |
.SH "SEE ALSO"
|
| 153 |
ps(1) regex(7) signal(7) killall(1) skill(1) kill(1) kill(2)
|
| 154 |
|
| 155 |
.SH STANDARDS
|
| 156 |
\fBsplashy_pkill\fP and \fBsplashy_pgrep\fP were introduced in Sun's Solaris 7. This
|
| 157 |
implementation is fully compatible.
|
| 158 |
|
| 159 |
.SH AUTHOR
|
| 160 |
Kjetil Torgrim Homme <kjetilho@ifi.uio.no>
|
| 161 |
|
| 162 |
Albert Cahalan <albert@users.sf.net> is the current maintainer of
|
| 163 |
the procps package.
|
| 164 |
|
| 165 |
Luis Mondesi <lemsx1@gmail.com> modified it for Splashy
|
| 166 |
|
| 167 |
Please send bug reports to <procps-feedback@lists.sf.net>
|