Copyright (C) 2000-2012 |
Manpages PGREPSection: Linux User's Manual (1)Updated: June 25, 2000 Index Return to Main Contents NAMEpgrep, pkill - look up or signal processes based on name and other attributesSYNOPSISpgrep [-flnvx] [-d delimiter] [-P ppid,...] [-g pgrp,...][-s sid,...] [-u euid,...] [-U uid,...] [-G gid,...] [-t term,...] [pattern]
pkill [-signal] [-fnvx] [-P ppid,...] [-g pgrp,...]
DESCRIPTIONpgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout. All the criteria have to match. For example,pgrep -u root sshd will only list the processes called sshd AND owned by root. On the other hand, pgrep -u root,daemon will list the processes owned by root OR daemon. pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout. OPTIONS
OPERANDS
EXAMPLESExample 1: Find the process ID of the named daemon:unix$ pgrep -u root named Example 2: Make syslog reread its configuration file: unix$ pkill -HUP syslogd Example 3: Give detailed information on all xterm processes: unix$ ps -fp $(pgrep -d, -x xterm) Example 4: Make all netscape processes run nicer: unix$ renice +4 `pgrep netscape` EXIT STATUS
NOTESThe process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat. Use the -f option to match against the complete command line, /proc/pid/cmdline.The running pgrep or pkill process will never report itself as a match. BUGSThe options -n and -v can not be combined. Let me know if you need to do this.Defunct processes are reported. SEE ALSOps(1) proc(5) regex(5)STANDARDSpkill and pgrep were introduced in Sun's Solaris 7. This implementation is fully compatible.AUTHORKjetil Torgrim Homme <kjetilho@ifi.uio.no>Michael K. Johnson <johnsonm@redhat.com> is the current maintainer of the procps package. Please send bug reports to <procps-bugs@redhat.com>
Index
This document was created by man2html, using the manual pages. Time: 13:52:07 GMT, April 26, 2024 |