mv
$ which mv
$ man mv
# mv [-f] source target/ target folder
$ sudo mv -f mongodb-macos-x86_64-4.2.6.tgz /usr/local
demo
➜ Desktop which mv
/bin/mv
➜ Desktop man mv
➜ Desktop mv mongodb-macos-x86_64-4.2.6.tgz /usr/local
mv: rename mongodb-macos-x86_64-4.2.6.tgz to /usr/local/mongodb-macos-x86_64-4.2.6.tgz: Permission denied
➜ Desktop sudo mv -f mongodb-macos-x86_64-4.2.6.tgz /usr/local
Password:
➜ Desktop
# 进入 /usr/local
$ cd /usr/local
# 下载
$ sudo curl -O https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.6.tgz
# 解压
$ sudo tar -zxvf mongodb-macos-ssl-x86_64-4.2.6.tgz
# 重命名为 mongodb 目录, mv ? rename
$ sudo mv mongodb-macos-x86_64-4.2.6/ mongodb
$ ./mongo
$ > quit()
$ show dbs
$ db
$ use local