Commit | Line | Data |
---|---|---|
c1030a02 TL |
1 | .TH MV 1 |
2 | .SH NAME | |
3 | mv \- move or rename files | |
4 | .SH SYNOPSIS | |
5 | .B mv | |
6 | file1 file2 | |
7 | .PP | |
8 | .B mv | |
9 | file ... directory | |
10 | .SH DESCRIPTION | |
11 | .I Mv | |
12 | moves (changes the name of) | |
13 | .I file1 | |
14 | to | |
15 | .IR file2 . | |
16 | .PP | |
17 | If | |
18 | .I file2 | |
19 | already exists, | |
20 | it is removed before | |
21 | .I file1 | |
22 | is moved. | |
23 | If | |
24 | .I file2 | |
25 | has a mode which forbids writing, | |
26 | .I mv | |
27 | prints the mode (see | |
28 | .IR chmod (2)) | |
29 | and | |
30 | reads the standard input to obtain a line; | |
31 | if the line begins with | |
32 | .B y, | |
33 | the move takes place; | |
34 | if not, | |
35 | .I mv | |
36 | exits. | |
37 | .PP | |
38 | In the second form, | |
39 | one or more | |
40 | .I files | |
41 | are moved to the | |
42 | .I directory | |
43 | with their original | |
44 | file-names. | |
45 | .PP | |
46 | .I Mv | |
47 | refuses to move a file onto itself. | |
48 | .SH "SEE ALSO" | |
49 | cp(1), chmod(2) | |
50 | .SH BUGS | |
51 | If | |
52 | .I file1 | |
53 | and | |
54 | .I file2 | |
55 | lie on different file systems, | |
56 | .I mv | |
57 | must copy the file and delete the original. | |
58 | In this case the owner name becomes | |
59 | that of the copying process and any | |
60 | linking relationship with other files | |
61 | is lost. | |
62 | .PP | |
63 | Directories may only be moved within the same parent | |
64 | directory. | |
65 | .PP | |
66 | .I Mv | |
67 | should take | |
68 | .B \-f | |
69 | flag, like | |
70 | .I rm, | |
71 | to suppress the question | |
72 | if the target exists and is not writable. |