Move and Rename

mv Move and Rename

1. Use mv ro rename

1) if file1 in Documents, and currently in Documents

Rename file1 to file2

1
$ mv file1 file2

2) if file1 not in Documents

Move file1 to Documents and rename it to file2

1
$ mv file1 file2

Note: file1 的位置可以在GUI里拖拽到Terminal

2. Move File

Formula

1
$ mv File Diretory

File可以是File/Directory

移动文件到上一级Directory

1
$ mv File ../

移动到当前文件夹

1
$ mv File .