Comments on Linux pgrep Command Tutorial for Beginners (10 Examples)

You might already know about the grep command in Linux, which searches for a pattern, and then prints the matching text in output. What if the requirement is to apply this kind of processing to fetch select information about processes currently running in the system?

2 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: prabeen

Q2 pgrep -c option is an invalid option.

By: dlwilson88

-c, --count Suppress normal output; instead print a count of matching processes. When count does not match anything, e.g. returns zero, the command will return non-zero value.run by itself it will return “0”$ pgrep -cv [$USER]

 ?

gave me "335"

pgrep(1)