December 2018
Beginner
320 pages
8h 57m
English
The pgrep command is used to look up currently running processes based on their name and other attributes, and displays the matching process PID. Its syntax is as follows:
$ pgrep [options] pattern
The following are examples to explain the use of the pgrep command:
To list processes with the sshd command name, which is also owned by root, execute the command line as follows:
$ pgrep -u root sshd
To list processes owned by the user root or daemon, execute the command line as follows:
$ pgrep -u root,daemon
The pgrep command can be used to list processes by specifying a pattern containing the process name. The following command line will find the PID of process that has the name of Firefox:
$ pgrep firef
The following ...
Read now
Unlock full access