how to know if mongodb was installed and running in macos code example Example: check if mongodb is running mac ps -ef | grep mongod | grep -v grep | wc -l | tr -d ' '