0

I have installed mongoDB in my centOS server by using the below command:

1) Create a /etc/yum.repos.d/mongodb-org-3.4.repo file and insert:

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

2) sudo yum install -y mongodb-org

When I type mongo -version, I get MongoDB shell version v3.4.6

But I coudn't locate the bin directory in my machine. Where is the default directory of mongodb located on linux and how to find it? Any help is appreciated. Thanks

2

You can use which mongo to get the path to the binary. From the man: which - shows the full path of (shell) commands.

Another option is to check where the RPM was installed to rpm -ql mongo and for additional info of the RPM rpm -qi mongo

To get the name of the package, in case its not mongo, use rpm -qa | grep mongo to look for RPMs containing the name mongo

  • Thanks for your reply. When I use which mongo command, I get /usr/bin/mongo. This is a binary file.There is no folder inside of /usr/bin/mongo. I would like to find out where the bin folder is located. (mongo/bin) – Rose Jul 31 '17 at 17:31
  • I added another option using rpm. Hope this is what you were looking for – Chen A. Jul 31 '17 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.