no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | pgrep [2015/10/05 19:54] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== pgrep ====== | ||
+ | Search for process names using grep | ||
+ | |||
+ | == Display all processes a user is running == | ||
+ | |||
+ | < | ||
+ | pgrep -u user -l | ||
+ | </ | ||
+ | |||
+ | == Match a pattern == | ||
+ | |||
+ | < | ||
+ | pgrep -f shell.sh | ||
+ | </ | ||
+ | |||
+ | == Display full command == | ||
+ | |||
+ | Requires a field argument. | ||
+ | |||
+ | < | ||
+ | pgrep -f shell.sh -a | ||
+ | </ | ||
+ | |||
+ | == Display PID and binary name == | ||
+ | |||
+ | < | ||
+ | pgrep -l sshd | ||
+ | </ | ||
+ | |||
+ | == Display number of processes running matching a name == | ||
+ | |||
+ | Useful for cron jobs: | ||
+ | |||
+ | < | ||
+ | pgrep -u clients -x rdiff-backup -c | ||
+ | </ |