1 .\" $NetBSD: mv.1,v 1.24 2003/08/07 09:05:18 agc Exp $
3 .\" Copyright (c) 1989, 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" This code is derived from software contributed to Berkeley by
7 .\" the Institute of Electrical and Electronics Engineers, Inc.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" @(#)mv.1 8.1 (Berkeley) 5/31/93
47 .Ar source ... directory
49 In its first form, the
51 utility renames the file named by the
53 operand to the destination path named by the
56 This form is assumed when the last operand does not name an already
61 moves each file named by a
63 operand to a destination file in the existing directory named by the
66 The destination path for each operand is the pathname produced by the
67 concatenation of the last operand, a slash, and the final pathname
68 component of the named file.
70 The following options are available:
73 Do not prompt for confirmation before overwriting the destination
78 to write a prompt to standard error before moving a file that would
79 overwrite an existing file.
80 If the response from the standard input begins with the character ``y'',
81 the move is attempted.
85 to be verbose, showing files as they are processed.
92 options is the one which affects
96 It is an error for any of the
98 operands to specify a nonexistent file or directory.
100 It is an error for the
102 operand to specify a directory if the
104 exists and is not a directory.
106 If the destination path does not have a mode which permits writing,
108 prompts the user for confirmation as specified for the
118 are on different file systems,
120 will remove the destination file, copy the source file to the
121 destination, and then remove the source.
122 The effect is roughly equivalent to:
123 .Bd -literal -offset indent
124 rm -f destination_path \*[Am]\*[Am] \e
125 cp -PRp source_file destination_path \*[Am]\*[Am] \e
131 utility exits 0 on success, and \*[Gt]0 if an error occurs.
139 utility is expected to be
145 option is an extension to