mv.1 (4721B)
1 .\" 2 .\" Sccsid @(#)mv.1 1.15 (gritter) 1/24/05 3 .\" Parts taken from cp(1) and mv(1), Unix 7th edition: 4 .\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 5 .\" 6 .\" Redistribution and use in source and binary forms, with or without 7 .\" modification, are permitted provided that the following conditions 8 .\" are met: 9 .\" Redistributions of source code and documentation must retain the 10 .\" above copyright notice, this list of conditions and the following 11 .\" disclaimer. 12 .\" Redistributions in binary form must reproduce the above copyright 13 .\" notice, this list of conditions and the following disclaimer in the 14 .\" documentation and/or other materials provided with the distribution. 15 .\" All advertising materials mentioning features or use of this software 16 .\" must display the following acknowledgement: 17 .\" This product includes software developed or owned by Caldera 18 .\" International, Inc. 19 .\" Neither the name of Caldera International, Inc. nor the names of 20 .\" other contributors may be used to endorse or promote products 21 .\" derived from this software without specific prior written permission. 22 .\" 23 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 24 .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 25 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 .\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE 28 .\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 34 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 .TH MV 1 "1/24/05" "Heirloom Toolchest" "User Commands" 36 .SH NAME 37 mv \- move or rename files and directories 38 .SH SYNOPSIS 39 \fBmv\fR [\fB\-f\fR] [\fB\-i\fR] [\fB\-b\ \fIsize\fR] 40 \fIfile1\fR [\fIfile2\fR .\ .\ .\ ] \fItarget\fR 41 .SH DESCRIPTION 42 .B Mv 43 moves (changes the name of) 44 .I file1 45 to 46 .IR target . 47 If 48 .I target 49 is an existing regular file, 50 its content is overwritten. 51 Its mode and owner are preserved; 52 the mode of the source file is used otherwise. 53 If 54 the mode of 55 .I target 56 forbids writing 57 (and standard input is terminal for 58 .B /usr/5bin/mv 59 and 60 .BR /usr/5bin/s42/mv ), 61 .B mv 62 prints the mode 63 (see 64 .IR chmod (2)) 65 and reads the standard input 66 to obtain a line; 67 if the line begins with y, 68 the move takes place; 69 if not, 70 the file is not moved. 71 .PP 72 If 73 .I target 74 is a directory, 75 one or more files are copied 76 into the directory with their original file-names. 77 .PP 78 .B Mv 79 refuses to move a file onto itself. 80 .PP 81 The 82 .B mv 83 command accepts the following options: 84 .TP 85 .B \-f 86 .B Mv 87 will not ask for confirmation 88 even if the modes of the 89 .I target 90 file do not permit writing. 91 Overrides the 92 .B \-i 93 option in 94 .B /usr/5bin/posix/mv 95 and 96 .BR /usr/5bin/posix2001/mv . 97 .TP 98 .B \-i 99 .B mv 100 will ask for confirmation 101 before overwriting an existing target. 102 For 103 .B /usr/5bin/mv 104 and 105 .BR /usr/5bin/s42/mv , 106 this flag will be automatically disabled 107 if standard input is not a terminal. 108 Overrides the 109 .B \-f 110 option in 111 .B /usr/5bin/posix/mv 112 and 113 .BR /usr/5bin/posix2001/mv . 114 .PP 115 The following option is an extension: 116 .TP 117 \fB\-b\ \fIsize\fR 118 When a regular file is moved to another file system, 119 its data must be copied. 120 This option overrides the automatically determined 121 i/o buffer size for such copies; 122 .I size 123 is given in bytes. 124 .SH "SEE ALSO" 125 cp(1), 126 cat(1), 127 pr(1), 128 unlink(2) 129 .SH NOTES 130 Use either 131 .RS 132 .sp 133 .B mv 134 .B \-\- 135 .I \-file 136 .I target 137 .sp 138 .RE 139 or 140 .RS 141 .sp 142 .B mv 143 .I ./\-file 144 .I target 145 .sp 146 .RE 147 to move files that begin with a hyphen character. 148 .PP 149 If source and target 150 lie on different file systems, 151 .B mv 152 must copy the file and delete the original. 153 In this case 154 any linking relationship with other files is lost, 155 but 156 .B mv 157 will preserve linkage inside the moved tree. 158 .B Mv 159 will try to preserve access and modification times, 160 user and group ownerships, 161 and file permission bits. 162 Failing to preserve these modes 163 is not considered an error, 164 only 165 .B /usr/5bin/posix/mv 166 and 167 .B /usr/5bin/posix2001/mv 168 will print an error message. 169 Special files 170 such as block and character devices, 171 FIFOs, 172 and symbolic links 173 are recreated in the target hierarchy. 174 .PP 175 The pathname contained in a symbolic link 176 is not changed when the link is moved. 177 Symbolic links with relative pathnames 178 may thus change or lose their target 179 if moved to a different level in the file hierarchy.