linux move file / folder bash command

时间:2023-03-09 20:16:59
linux move file / folder bash command

linux move file / folder bash command

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

linux move file / folder bash command

➜  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

https://www.runoob.com/mongodb/mongodb-osx-install.html

linux move file / folder bash command

linux move file / folder bash command

linux move file / folder bash command

linux move file / folder bash command

linux move file / folder bash command


$ ./mongo $ > quit() $ show dbs
$ db
$ use local

https://www.runoob.com/mongodb/mongodb-databases-documents-collections.html