PGREP(1) PGREP(1) pgrep, pkill, pidwait -- , pgrep [] pkill [] pidwait [] pgrep , stdout. . , $ pgrep -u root sshd , sshd root. , $ pgrep -u root,daemon , root daemon. pkill ( SIGTERM) , stdout. pidwait stdout. - --signal , . . pgrep pidwait . , --require-handler . -c, --count . , . , , , . , pkill pidwait , , , , . -d, --delimiter , ( ). ( pgrep.) -e, --echo PID , ( pkill). -f, --full , . -f, . -g, --pgroup ,... . 0 pgrep, pkill pidwait. -G, --group gid,... . . -i, --ignore-case . -l, --list-name , . ( pgrep.) -a, --list-full , . ( pgrep.) -n, --newest ( ) . -o, --oldest ( ) . -O, --older , . -P, --parent ppid,... , . -s, --session sid,... , . 0 pgrep, pkill pidwait. -t, --terminal ,... . <>. -u, --euid euid,... . . -U, --uid uid,... . . -v, --inverse . , pgrep pidwait. pkill , . -w, --lightweight , , pgrep pidwait. pkill . -x, --exact , ( , -f) . -F, --pidfile PID . , pkill pidwait, pgrep. -L, --logpidfile , pid- (. -F) . -r, --runstates D,R,S,Z,... , . -A, --ignore-ancestors pgrep, pkill pidwait. , sudo . -H, --require-handler , , , . --cgroup ,... (cgroup) 2. . cgroups(8) --ns pid , . root. . --nslist, , . --nslist ,... . : ipc, mnt, net, pid, user, uts. -q, --queue kill(2) sigqueue(3), , , . , , , SA_SIGINFO sigaction(2), si_value siginfo_t. -V, --version . -h, --help . . 1: named: $ pgrep -u root named 2: syslog : $ pkill -HUP syslogd 3: xterm: $ ps -fp $(pgrep -d, -x xterm) 4: chrome: $ renice +4 $(pgrep chrome) 0 . pkill pidwait , . 1 . 2 . 3 : ' . , , 15 , /proc/pid/stat. , /proc/pid/cmdline, -f. , , . pgrep, pkill pidwait . -O --older , /proc subset=pid. -n, -o -v . , . . pidwait pidfd_open(2), ' Linux 5.3. ps(1), regex(7), signal(7), sigqueue(3), killall(1), skill(1), kill(1), kill(2), cgroups(8). Kjetil Torgrim Homme , , procps-ng 16 2023 PGREP(1)