.TH MV 1 "1 April 1981" .UC 4 .SH NAME mv \- move or rename files .SH SYNOPSIS .B mv [ .B \-i ] [ .B \-f ] [ .B \- ] file1 file2 .PP .B mv [ .B \-i ] [ .B \-f ] [ .B \- ] file ... directory .SH DESCRIPTION .I Mv moves (changes the name of) .I file1 to .IR file2 . .PP If .I file2 already exists, it is removed before .I file1 is moved. If .I file2 has a mode which forbids writing, .I mv prints the mode (see .IR chmod (2)) and reads the standard input to obtain a line; if the line begins with .B y, the move takes place; if not, .I mv exits. .PP In the second form, one or more .I files (plain files or directories) are moved to the .I directory with their original file-names. .PP .I Mv refuses to move a file onto itself. .PP Options: .TP .B \-i stands for interactive mode. Whenever a move is to supercede an existing file, the user is prompted by the name of the file followed by a question mark. If he answers with a line starting with 'y', the move continues. Any other reply prevents the move from occurring. .TP .B \-f stands for force. This option overrides any mode restrictions or the \-i switch. .TP .B \- means interpret all the following arguments to .I mv as file names. This allows file names starting with minus. .SH "SEE ALSO" cp(1), ln(1) . \".SH MESSAGES . \".IP "usage: mv [-if] f1 f2; or mv [-if] d1 d2; or mv [-if] f1 ... fn d1" 10 . \".br . \"Standard memory jogger message to inform you how to use the \fImv\fP command. . \".IP "mv: cannot access \fIfilename\fP" 10 . \".br . \".IP "mv: directory rename only" 10 . \".br . \".IP "mv: \fIdirectory\fP is a directory" 10 . \".br . \".IP "remove \fIfilename\fP? " 10 . \".br . \".IP "mv: \fIfilename\fP and \fIfilename\fP are identical" 10 . \".br . \".IP "override protection \fInnn\fP for \fIfilename\fP? " 10 . \".br . \".IP "mv: cannot unlink \fIfilename\fP" 10 . \".br . \".IP "mv: try again" 10 . \".br . \".IP "mv: cannot exec cp" 10 . \".br . \".IP "mv: cannot unlink \fIfilename\fP" 10 . \".br . \".IP "mv: \fIfilename\fP exists" 10 . \".br . \".IP "mv :target name too long" 10 . \".br . \".IP "mv: \fIfilename\fP exists" 10 . \".br . \".IP "mv: ?? source == target, source exists and target doesnt" 10 . \".br . \".IP "mv: cannot rename \fIfilename\fP" 10 . \".br . \".IP "mv: cannot locate parent" 10 . \".br . \".IP "mv: no write access to \fIfilename\fP" 10 . \".br . \".IP "mv: cannot move directories across devices" 10 . \".br . \".IP "mv: Sorry, path names including \fIfilename\fP aren't allowed" 10 . \".br . \".IP "mv: cannot link \fIfilename\fP to \fIfilename\fP" 10 . \".br . \".IP "mv: \fIfilename\fP: cannot unlink" 10 . \".br . \".IP "mv: cannot link \fIfilename\fP and \fIfilename\fP" 10 . \".br . \".IP "mv: ?? cannot unlink \fIfilename\fP" 10 . \".br . \".IP "mv: cannot access \fIfilename\fP" 10 . \".br . \".IP "mv: cannot move a directory into itself" 10 . \".br . \".IP "mv: name too long" 10 . \".br .SH BUGS If .I file1 and .I file2 lie on different file systems, .I mv must copy the file and delete the original. In this case the owner name becomes that of the copying process and any linking relationship with other files is lost.