What command should I use to change the dbPath
setting of MongoDB installed on a linux system? The default settings are found in /etc/mongod.conf
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
net:
port: 27017
bindIp: 127.0.0.1
Alex :
Did you mean change the conf file without a editor? If yes, you could use 'sed'\n\n$ sed -i 's@/var/lib/mongodb@/your/new/directory/here@g' configfile\n\n\nor if you want to change just dbPath:\n\n$ sed -i '/dbPath/s/:.*/: \\/your\\/new\\/directory\\/here' configfile\n",
2016-01-06T14:56:05