Commit | Line | Data |
---|---|---|
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 | |
10 | mv \- 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 | |
31 | moves (changes the name of) | |
32 | .I file1 | |
33 | to | |
34 | .IR file2 . | |
35 | .PP | |
36 | If | |
37 | .I file2 | |
38 | already exists, | |
39 | it is removed before | |
40 | .I file1 | |
41 | is moved. | |
42 | If | |
43 | .I file2 | |
44 | has a mode which forbids writing, | |
45 | .I mv | |
46 | prints the mode (see | |
47 | .IR chmod (2)) | |
48 | and | |
49 | reads the standard input to obtain a line; | |
50 | if the line begins with | |
51 | .B y, | |
52 | the move takes place; | |
53 | if not, | |
54 | .I mv | |
55 | exits. | |
56 | .PP | |
57 | In the second form, | |
58 | one or more | |
59 | .I files | |
60 | are moved to the | |
61 | .I directory | |
62 | with their original | |
63 | file-names. | |
64 | .PP | |
65 | .I Mv | |
66 | refuses to move a file onto itself. | |
67 | .PP | |
68 | Options: | |
69 | .TP | |
70 | .B \-i | |
71 | stands for interactive mode. Whenever a move is to supercede an | |
72 | existing file, the user is prompted by the name of the file | |
73 | followed by a question mark. If he answers with a line starting | |
74 | with 'y', the move continues. Any other reply prevents the move from | |
75 | occurring. | |
76 | .TP | |
77 | .B \-f | |
78 | stands for force. This option overrides any mode restrictions or the | |
79 | \-i switch. | |
80 | .TP | |
81 | .B \- | |
82 | means interpret all the following arguments to | |
83 | .I mv | |
84 | as file names. This allows file names starting with minus. | |
85 | .SH "SEE ALSO" | |
86 | cp(1), ln(1) | |
87 | .SH BUGS | |
88 | If | |
89 | .I file1 | |
90 | and | |
91 | .I file2 | |
92 | lie on different file systems, | |
93 | .I mv | |
94 | must copy the file and delete the original. | |
95 | In this case the owner name becomes | |
96 | that of the copying process and any | |
97 | linking relationship with other files | |
98 | is lost. | |
99 | .PP | |
100 | Directories may only be moved within the same parent | |
101 | directory. |