Let's say I run the following commands:
sleep 500 /bin/sleep 500 sleep 30
What I'm interested is, how to count the number of instances of the sleep program, with certain arguments (in this case the only argument is
So in the example above, if I count the number of instances of
/bin/sleep 500, it should return 2.
I tried this:
pgrep -xfc '/bin/sleep 500', but since it exactly matched the argument in the parenthesis,
sleep 500 isn't counted.