Issue
Using pgrep 3.3.10
, if I want to know the number of processing running with commands which match the string pippo
I can do watch -n 1 'pgrep -c pippo'
. With pgrep 3.2.8
it doesn't work, it gives me:
pgrep: invalid option -- 'c' Usage: pgrep [-flvx] [-d DELIM] [-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST] [-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] [PATTERN]
Is there an equivalent way of giving me a continuously updating number of commands matching a string in pgrep 3.2.8
?
Solution
Pipe it to wc -l
:
watch -n 1 'pgrep pippo | wc -l'
Answered By - Thor Answer Checked By - Katrina (WPSolving Volunteer)