Name
mv
Synopsis
mv [option]sources target
Moves or renames files and directories. The source (first column) and target (second column) determine the result (third column):
|
Source |
Target |
Result |
|---|---|---|
|
File |
name (nonexistent) |
Rename file to name. |
|
File |
Existing file |
Overwrite existing file with source file. |
|
Directory |
name (nonexistent) |
Rename directory to name. |
|
Directory |
Existing directory |
Move directory to be a subdirectory of existing directory. |
|
One or more files |
Existing directory |
Move files to directory. |
mv does not preserve resource forks or HFS
metadata when moving files that contain them. For such files, use
MvMac instead.
Options
-
-f Force the move, even if target file exists; suppress messages about restricted access modes.
-
-i Query user before removing files.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access