manual page distributed with 4.1BSD
[unix-history] / usr / src / bin / mv / mv.1
CommitLineData
1c59be2d
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)mv.1 4.1 (Berkeley) %G%
6.\"
7.TH MV 1 4/1/81
8.UC 4
9.SH NAME
10mv \- move or rename files
11.SH SYNOPSIS
12.B mv
13[
14.B \-i
15] [
16.B \-f
17] [
18.B \-
19] file1 file2
20.PP
21.B mv
22[
23.B \-i
24] [
25.B \-f
26] [
27.B \-
28] file ... directory
29.SH DESCRIPTION
30.I Mv
31moves (changes the name of)
32.I file1
33to
34.IR file2 .
35.PP
36If
37.I file2
38already exists,
39it is removed before
40.I file1
41is moved.
42If
43.I file2
44has a mode which forbids writing,
45.I mv
46prints the mode (see
47.IR chmod (2))
48and
49reads the standard input to obtain a line;
50if the line begins with
51.B y,
52the move takes place;
53if not,
54.I mv
55exits.
56.PP
57In the second form,
58one or more
59.I files
60are moved to the
61.I directory
62with their original
63file-names.
64.PP
65.I Mv
66refuses to move a file onto itself.
67.PP
68Options:
69.TP
70.B \-i
71stands for interactive mode. Whenever a move is to supercede an
72existing file, the user is prompted by the name of the file
73followed by a question mark. If he answers with a line starting
74with 'y', the move continues. Any other reply prevents the move from
75occurring.
76.TP
77.B \-f
78stands for force. This option overrides any mode restrictions or the
79\-i switch.
80.TP
81.B \-
82means interpret all the following arguments to
83.I mv
84as file names. This allows file names starting with minus.
85.SH "SEE ALSO"
86cp(1), ln(1)
87.SH BUGS
88If
89.I file1
90and
91.I file2
92lie on different file systems,
93.I mv
94must copy the file and delete the original.
95In this case the owner name becomes
96that of the copying process and any
97linking relationship with other files
98is lost.
99.PP
100Directories may only be moved within the same parent
101directory.