Sccsid @(#)mv.1 1.15 (gritter) 1/24/05
Parts taken from cp(1) and mv(1), Unix 7th edition:
Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code and documentation must retain the
above copyright notice, this list of conditions and the following
disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed or owned by Caldera
International, Inc.
Neither the name of Caldera International, Inc. nor the names of
other contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE
LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MV 1 "1/24/05" "Heirloom Toolchest" "User Commands"
NAME
mv - move or rename files and directories
SYNOPSIS
mv [-f] [-i] [-b size] file1 [file2 . . . ] target
DESCRIPTION
Mv moves (changes the name of) file1 to target . If target is an existing regular file, its content is overwritten. Its mode and owner are preserved; the mode of the source file is used otherwise. If the mode of target forbids writing (and standard input is terminal for /usr/5bin/mv and /usr/5bin/s42/mv ), mv prints the mode (see chmod (2)) and reads the standard input to obtain a line; if the line begins with y, the move takes place; if not, the file is not moved.

If target is a directory, one or more files are copied into the directory with their original file-names.

Mv refuses to move a file onto itself.

The mv command accepts the following options:

-f Mv will not ask for confirmation even if the modes of the target file do not permit writing. Overrides the -i option in /usr/5bin/posix/mv and /usr/5bin/posix2001/mv .

-i mv will ask for confirmation before overwriting an existing target. For /usr/5bin/mv and /usr/5bin/s42/mv , this flag will be automatically disabled if standard input is not a terminal. Overrides the -f option in /usr/5bin/posix/mv and /usr/5bin/posix2001/mv .

The following option is an extension:

-b size When a regular file is moved to another file system, its data must be copied. This option overrides the automatically determined i/o buffer size for such copies; size is given in bytes.

"SEE ALSO"
cp(1), cat(1), pr(1), unlink(2)
NOTES
Use either

mv -- -file target

or

mv ./-file target

to move files that begin with a hyphen character.

If source and target lie on different file systems, mv must copy the file and delete the original. In this case any linking relationship with other files is lost, but mv will preserve linkage inside the moved tree. Mv will try to preserve access and modification times, user and group ownerships, and file permission bits. Failing to preserve these modes is not considered an error, only /usr/5bin/posix/mv and /usr/5bin/posix2001/mv will print an error message. Special files such as block and character devices, FIFOs, and symbolic links are recreated in the target hierarchy.

The pathname contained in a symbolic link is not changed when the link is moved. Symbolic links with relative pathnames may thus change or lose their target if moved to a different level in the file hierarchy.