Check if mongdb is running on mac / linux - centos

ps -ef | grep mongod | grep -v grep | wc -l | tr -d ' '

ps -ef | grep mongod | grep -v grep | wc -l | tr -d ' '

alias checkmongo="ps -ef | grep mongod | grep -v grep | wc -l | tr -d ' '"

Set the alias to call it easily.  :)


Check the detail explanation about the ps command here : http://stackoverflow.com/questions/31561098/how-to-check-if-mongo-db-is-running-on-mac
and here
http://linuxcommand.org/man_pages/ps1.html


Popular posts from this blog

npm refusing to install as a dependency of itself

How to call javascript functions from VB.NET and using WebBrowser Control