mv
[options] sources targetBasic command to move files and directories around on the system or to rename them. mv works as the following table shows.
Source | Target | Result |
---|---|---|
File | name | Rename file as name. |
File | Existing file | Overwrite existing file with source file. |
Source | Target | Result |
---|---|---|
Directory | name | Rename directory as name. |
Directory | Existing directory | Move directory to be a subdirectory of existing directory. |
One or more files | Existing directory | Move files to directory. |
--
Use this when one of the names begins with a -
. For compatibility with old programs, a plain -
also works.
-f
Force the move, even if target file exists; suppress messages about restricted access modes.
-i
Inquire; prompt for a y
(yes) response before overwriting an existing target.