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
No comments:
Post a Comment