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_linux move file

➜  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


linux move file / folder bash command_linux move file_02

linux move file / folder bash command_mongodb_03

linux move file / folder bash command_Linux下载 links_04

linux move file / folder bash command_cp/mv/rm_05

linux move file / folder bash command_linux move file_06


$ ./mongo

$ > quit()

$ show dbs
$ db
$ use local