Installing MongoDB- mongod –config /usr/local/etc/mongod.conf –fork returns: bash: mongod: command not found


This Content is from Stack Overflow. Question asked by Tyler Smax

Downloading MongoDB
I’m finding it hard to download MongoDB in the background. I’m successful with the command:

brew services start mongodb-community@4.2 ,

but every time i try the command:

mongod –config /usr/local/etc/mongod.conf –fork,

it writes:

bash: mongod: command not found.

The command:

brew services list

works and runs the following:

Name Status User File

mongodb-community@4.2 started myName ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community@4.2.plist

However, when I run:

mongod –config /usr/local/etc/mongod.conf –fork

It writes:

bash: mongod: command not found

Any help?

I am quite new to Computer Science and I only got recently acquainted with the Terminal so be nice!


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?