<s>
pgrep	B-Device
is	O
a	O
command-line	B-Application
utility	O
initially	O
written	O
for	O
use	O
with	O
the	O
Solaris	B-Application
7	I-Application
operating	O
system	O
by	O
Mike	O
Shapiro	O
.	O
</s>
<s>
It	O
has	O
since	O
been	O
available	O
in	O
illumos	B-Application
and	O
reimplemented	O
for	O
the	O
Linux	B-Application
and	O
BSDs	B-Operating_System
(	O
DragonFly	B-Application
BSD	I-Application
,	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
,	O
and	O
OpenBSD	B-Operating_System
)	O
.	O
</s>
<s>
It	O
searches	O
for	O
all	O
the	O
named	O
processes	B-Operating_System
that	O
can	O
be	O
specified	O
as	O
extended	O
regular	B-Language
expression	I-Language
patterns	O
,	O
and	O
—	O
by	O
default	O
—	O
returns	O
their	O
process	B-Operating_System
ID	I-Operating_System
.	O
</s>
<s>
Alternatives	O
include	O
pidof	O
(	O
finds	O
process	B-Operating_System
ID	I-Operating_System
given	O
a	O
program	O
name	O
)	O
and	O
ps	B-Application
.	O
</s>
<s>
The	O
default	O
behaviour	O
of	O
pgrep	B-Device
(	O
returning	O
the	O
process	B-Operating_System
identifier	I-Operating_System
of	O
the	O
named	O
tasks	O
)	O
simplifies	O
an	O
otherwise	O
complex	O
task	O
and	O
is	O
invoked	O
with	O
:	O
</s>
<s>
Additional	O
functionality	O
of	O
pgrep	B-Device
is	O
listing	O
the	O
process	O
name	O
as	O
well	O
as	O
the	O
PID	O
(	O
-l	O
Lists	O
the	O
process	O
name	O
as	O
well	O
as	O
the	O
process	B-Operating_System
ID	I-Operating_System
)	O
of	O
all	O
processes	B-Operating_System
belonging	O
to	O
the	O
group	O
alice	O
(	O
-G	O
Only	O
match	O
processes	B-Operating_System
whose	O
real	O
group	O
ID	B-Application
is	O
listed	O
.	O
</s>
<s>
showing	O
all	O
processes	B-Operating_System
that	O
do	O
not	O
belong	O
to	O
the	O
user	O
root	B-Application
(	O
-u	O
euid	O
Only	O
match	O
processes	B-Operating_System
whose	O
effective	O
user	O
ID	B-Application
is	O
listed	O
.	O
</s>
<s>
and	O
only	O
matching	O
the	O
most	O
recently	O
started	O
process	O
(	O
-n	O
Select	O
only	O
the	O
newest	O
(	O
most	O
recently	O
started	O
)	O
of	O
the	O
matching	O
processes	B-Operating_System
)	O
:	O
</s>
