Problem scenario: You are not sure if MongoDB is installed on Linux. How do you find out for sure?
Solution: Use this command to see if it is actively running: ps -ef | grep mongo
However, MongoDB could be installed but not running. So this command will not definitively answer the question. On Debian (e.g., Ubuntu) or RedHat (e.g., CentOS or Fedora) distributions of Linux, use this command: mongod --version
The results will indicate if MongoDB is installed or not. You'll see the version if it is installed. The command will not work if MongoDB is not installed (e.g., with command not found).