In the learning activity mentioned in the title, it’s written:
You can verify that this was successful by running the command pgrep mongod to search for all running processes with the word “mongod” in their name. There should not be any matching process IDs, with the exception of pgrep mongod, which is the process for the search command you just ran that contains the name “mongod”.
pgrep mongod shows only the process number.
I suggest to change it to
pgrep -l mongod or even to
pgrep -a mongod.
By the way, I tried on few machines and
pgrep didn’t show the
pgrep command so I’m not even sure if it’s correct that pgrep might show the pgrep process in it’s output list.
It’s not like
ps -ef | grep mongod that shows
grep --color=auto mongod when you run it.