pgrep
The pgrep command searches the process table on the running system and prints the process IDs of all processes that match the criteria given on the command line.[1]
Documentation
Syntax
pgrep [PARAMETER ...] PATTERN
Parameters
- -a
- Include process ancestors in the match list. By default, the current pgrep process and all of its ancestors are excluded.
- -f
- Match against full argument lists. The default is to match against process names.
- -i
- Ignore case distinctions in both the process table and the supplied pattern.
- -l
- Long output. pgrep prints the process name in addition to the process ID for each matching process. If used in conjunction with -f, prints the process ID and the full argument list for each matching process.
- -P <PPID>
- Restrict matches to processes with a parent process ID in the comma-separated list PPID.
- -q
- Do not write anything to standard output.
- -U <UID>
- Restrict matches to processes with a real user ID in the comma-separated list UID.
- -x
- Require an exact match of the process name, or argument list if -f is given. The default is to match any substring.
References
- ↑ man 1 'pgrep'