|File: [cvs.NetBSD.org] / src / bin / mv / mv.1 (download)
Revision 1.25, Wed Mar 11 12:44:19 2009 UTC (11 years, 7 months ago) by joerg
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache
Changes since 1.24: +3 -3
Remove redundant tabs
.\" $NetBSD: mv.1,v 1.25 2009/03/11 12:44:19 joerg Exp $
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. 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.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 THE REGENTS OR CONTRIBUTORS 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 8.1 (Berkeley) 5/31/93
.Dd December 26, 2002
.Dt MV 1
.Nd move files
.Op Fl fiv
.Ar source target
.Op Fl fiv
.Ar source ... directory
In its first form, the
utility renames the file named by the
operand to the destination path named by the
This form is assumed when the last operand does not name an already
In its second form,
moves each file named by a
operand to a destination file in the existing directory named by the
The destination path for each operand is the pathname produced by the
concatenation of the last operand, a slash, and the final pathname
component of the named file.
The following options are available:
.Bl -tag -width flag
.It Fl f
Do not prompt for confirmation before overwriting the destination
.It Fl i
to write a prompt to standard error before moving a file that would
overwrite an existing file.
If the response from the standard input begins with the character ``y'',
the move is attempted.
.It Fl v
to be verbose, showing files as they are processed.
The last of any
options is the one which affects
.Nm Ns 's
It is an error for any of the
operands to specify a nonexistent file or directory.
It is an error for the
operand to specify a directory if the
exists and is not a directory.
If the destination path does not have a mode which permits writing,
prompts the user for confirmation as specified for the
.Xr rename 2
call fail because
are on different file systems,
will remove the destination file, copy the source file to the
destination, and then remove the source.
The effect is roughly equivalent to:
.Bd -literal -offset indent
rm -f destination_path \*[Am]\*[Am] \e
cp -PRp source_file destination_path \*[Am]\*[Am] \e
rm -rf source_file
.Sh EXIT STATUS
utility exits 0 on success, and \*[Gt]0 if an error occurs.
.Sh SEE ALSO
.Xr cp 1 ,
.Xr rename 2 ,
.Xr symlink 7
utility is expected to be
option is an extension to
.St -p1003.2 .