MV(1) UNIX Programmer's Manual MV(1)
mv - move or rename files
S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
m
\bmv
\bv [ -
\b-i
\bi ] [ -
\b-f
\bf ] [ -
\b- ] file1 file2
m
\bmv
\bv [ -
\b-i
\bi ] [ -
\b-f
\bf ] [ -
\b- ] file ... directory
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
_
\bM_
\bv moves (changes the name of) _
\bf_
\bi_
\bl_
\be_
\b1 to _
\bf_
\bi_
\bl_
\be_
\b2.
If _
\bf_
\bi_
\bl_
\be_
\b2 already exists, it is removed before _
\bf_
\bi_
\bl_
\be_
\b1 is
moved. If _
\bf_
\bi_
\bl_
\be_
\b2 has a mode which forbids writing, _
\bm_
\bv prints
the mode (see _
\bc_
\bh_
\bm_
\bo_
\bd(2)) and reads the standard input to
obtain a line; if the line begins with y
\by,
\b, the move takes
place; if not, _
\bm_
\bv exits.
In the second form, one or more _
\bf_
\bi_
\bl_
\be_
\bs (plain files or direc-
tories) are moved to the _
\bd_
\bi_
\br_
\be_
\bc_
\bt_
\bo_
\br_
\by with their original
_
\bM_
\bv refuses to move a file onto itself.
-
\b-i
\bi 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 contin-
ues. Any other reply prevents the move from occurring.
-
\b-f
\bf stands for force. This option overrides any mode res-
trictions or the -i switch.
-
\b- means interpret all the following arguments to _
\bm_
\bv as
file names. This allows file names starting with
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
If _
\bf_
\bi_
\bl_
\be_
\b1 and _
\bf_
\bi_
\bl_
\be_
\b2 lie on different file systems, _
\bm_
\bv must
copy the file and delete the original. In this case the
owner name becomes that of the copying process and any link-
ing relationship with other files is lost.
Printed 7/9/88 April 29, 1985 1