.TH mv "" "" Command
.PC "Rename files or directories"
\fBmv [\-f] \fIoldfile \fB[\fInewfile\^\fB]\fR
\fBmv [\-f] \fIfile ... directory\fR
.PP
.HS
.SH Option:
.IC \fB\-f\fR
Force: remove \fInewfile\fR even if unwritable
.HE
.B mv
renames files.
In the first form above, it changes the name of
.I oldfile
to
.IR newfile .
If
.I newfile
already exists,
.B mv
replaces it with the file being moved;
if not,
.B mv
creates it.
If
.I newfile
is a directory,
.B mv
places
.I oldfile
under that directory.
.PP
In the second form,
.B mv
moves each
.I file
so that it resides under
.IR directory . 
If a file with the new name exists but is unwritable,
.B mv
will not delete it unless the
.B \-f
option is specified.
.PP
.B mv
will not copy directories between devices and will not
remove directories that occupy the destination of the command.
.PP
Normally,
.B mv
creates a link
to the old file with the new file and then removes the old file.
If it cannot create the link
(e.g., because the new file is on a different file system than the old),
.B mv
performs a copy and then removes the old file.
.SH "See Also"
.Xr "commands," commands
.Xr "cp," cp
.Xr "ln," ln
.Xr "mvdir" mvdir
.SH Notes
.B mv
tests the validity of directory moves by means of search permission.
The superuser always has search permission and thus can use
.B mv
incorrectly.
