pgrep

Pgrep is a command line program that was originally developed for the Solaris 7 operating system. Since then, however, also a version for GNU / Linux and OpenBSD was written. The program will search for all named processes that can be specified as regular expressions, and returns by default its process ID. Among the alternatives are pidof, which was originally developed for Linux, and ps. pgrep itself is a simplified spelling of a complex chain of subroutine calls to simplify the input. However, it has expanded to include custom functionality to perform complex queries for processes.

Examples

Basic functionality

  • With the following call, the ID of a process is issued:
  • This is largely equivalent to the following call:

Advanced functionality

  • All processes ( with name and ID ) Show that belong to the other group:
  • View all processes that do not belong to the root user:
646213
de