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.
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.
mv -- -file target
mv ./-file target
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.