Name
mv
Synopsis
mv [option
]sources target
Moves or renames files and directories. In Table 2-4, the source (first column) and target (second column) determine the result (third column).
Source |
Target |
Result |
File |
|
Rename file to |
File |
Existing file |
Overwrite existing file with source file. |
Directory |
|
Rename directory to |
Directory |
Existing directory |
Move directory to be a subdirectory of existing directory. |
One or more files |
Existing directory |
Move files to directory. |
mv doesn’t 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. Overrides previous -i and -n options.
- -i
Query user before removing files. Overrides previous -f and -n options.
- -n
Don’t overwrite existing target files. Overrides previous -f and -i options.
- -v
Verbose; show files as they’re being moved.
Get Mac OS X Tiger in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.