Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cp(1)

ln(1)

MV(1)  —  Unix Programmer’s Manual

NAME

mv − move or rename files

SYNOPSIS

mv [ options ] file1 file2

mv [ options ] files directory

DESCRIPTION

Mv moves (changes the name of) file1 to file2.

If file2 already exists, it is removed before file1 is moved.  If the mode of file2 forbids writing, mv prints the mode (see chmod(2)) and reads the standard input to obtain a line.  If the line begins with y, the move takes place; if not, mv exits. 

In the second form, one or more files (plain files or directories) are moved to the directory with their original filenames. 

Mv will not move a file onto itself. 

OPTIONS

− Interprets all the following arguments as filenames.  This allows filenames starting with a minus sign. 

−f Forces overwriting of existing files. This option overrides any mode restrictions or the −i switch. 

−i 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 the user enters y, the move is executed;  any other reply aborts it. 

SEE ALSO

cp(1), ln(1)

BUGS

If file1 and file2 exist on different filesystems, 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. 

4th Berkeley Distribution  —  1 August 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026