Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

mv(1) OSS Shell and Utilities Reference Manual
NAME
mv - Moves les and directories
SYNOPSIS
mv [-i | f] le1 le2
mv [-i | f] le1 ... directory
mv [ -W NOG ][-W NOE ][-i | f] directory1 ... destination_directory
The mv command moves les from one directory to another or renames les and directories.
FLAGS
-f Overrides the -i ag and any mode restrictions. If both
-f and -i are specied (for
example, because an alias includes one of them) whichever appears last overrides the
other.
-i Prompts you with the name of the le followed by a question mark whenever a move is
to supercede an existing le. If the answer begins with y, or the locales equivalent of a
y, the move continues. Any other reply prevents the move from occurring. If both -f
and -i are specied (for example, because an alias includes one of them) whichever
appears last overrides the other.
HP Extensions
-W NOG Species that the /G directory should be omitted when the initial directory is
root. This ag is ignored when the initial directory is not /, /E,or/E/system.
-W NOE Species that the /E directory should be omitted when the initial directory is
root. This ag is ignored when the initial directory is not root.
Specify both the -W NOG and -W NOE ags to omit both the /G and /E directories.
DESCRIPTION
If you move a le to a new directory, mv retains the original lename. When you move a le, all
other links to the le remain intact.
In the second form, one or more les are moved to directory with their original lenames. In the
third form, one or more directories are moved to the destination directory with their original
names.
Note that mv does not move a le onto itself.
When you use mv to rename a le, the target le can be either a new lename or a new directory
pathname. If moving the le would overwrite an existing le, the existing le is overwritten
unless you specify the -i ag, in which case you will be prompted. If moving the le would
overwrite an existing le that does not have write permission set and if standard input is a tty, mv
displays the permission code of the le to be overwritten and reads one line from standard input.
If the line begins with y, or the locales equivalent of a y, the move takes place and the le is
overwritten. If not, mv does nothing with the le.
When you use mv to move a directory into an existing directory, the directory and its contents
are added under the existing directory.
If the access permissions of the destination_directory or the existing destination le (le2) forbid |
writing, the mv command asks the issuer of the command for permission to overwrite the le:
1. The mv command prints the mode (see "Access Control Lists (ACLs)," in this reference |
page, and the chmod(1) reference page) followed by the rst letters of the words yes and |
no in the language of the current locale, to standard output, prompting for a response.
626 Hewlett-Packard Company 527188-007