Questions tagged [pgrep]
32 questions
3
votes
2 answers
pgrep -f exits with 1
RUNNING_APPS=$(pgrep -f "somePattern")
echo $?
#results in
1
How can I make my command pass with exit code 0?

makozaki
- 133
3
votes
0 answers
pgrep -f matches on first 4096 characters only
pgrep on a Ubuntu 19.10 matches on a cmd line of about 10000 characters just fine, but the same version (see below) of pgrep on Debian 10 (buster) greps only on the first 4096 characters.
Is there a way to make the Debian version match on the whole…

Evgeniy Berezovsky
- 775
- 1
- 7
- 20
1
vote
1 answer
How to get a list of process ids of long command names, not command line parameters?
Since there's a 15-character limit on the length of process names in pgrep, I've been using pgrep -f to give me a list of process id's of running commands with longer names. However, it includes the full command line parameters, and this gives wrong…

NewtownGuy
- 31