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