HP-UX Reference (11i v1 00/12) - 1 User Commands A-M (vol 1)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
m
mv(1) mv(1)
If new-file is a new file, it inherits the access control list of file1, altered to reflect any difference in owner-
ship between the two files (see acl(5) and aclv(5)). In JFS file systems, new files created by mv do not
inherit their parent directory’s default ACL entries (if any), but instead retain their original ACLs. When
moving files from a JFS file system to an HFS file system or vice versa, optional ACL entries are lost.
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE determines the interpretation of text as single byte and/or multibyte characters.
LANG and LC_CTYPE determine the local language equivalentof y (for yes/no queries).
LANG determines the language in which messages are displayed.
If LC_CTYPE is not specified in the environment or is set to the empty string, the value of LANG is used as
a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a
default of C (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid
setting, mv behaves as if all internationalization variables are set to C. See environ(5).
International Code Set Support
Single character and multibyte character code sets are supported.
EXAMPLES
Rename a file in the current directory:
mv old-filename new-filename
Rename a directory in the current directory:
mv old-dirname new-dirname
Rename a file in the current directory whose name starts with a nonprinting control character or a charac-
ter that is special to the shell, such as - and * (extra care may be required depending on the situation):
mv ./bad-filename new-filename
mv ./?bad-filename new-filename
mv ./*bad-filename new-filename
Move directory sourcedir and its contents to a new location (targetdir) in the file system (upon
completion, a subdirectory named sourcedir resides in directory targetdir):
mv sourcedir targetdir
Move all files and directories (including links) in the current directory to a new location underneath tar-
getdir
:
mv * targetdir
Move all files and directories (including links) in sourcedir to a new location underneath targetdir
(sourcedir and targetdir are in separate directory paths):
mv sourcedir/* targetdir
WARNINGS
If file1 and new-file exist on different file systems, mv copies the file and deletes the original. In this case
the mover becomes the owner and any linking relationship with other files is lost.
mv cannot carry hard
links across file systems. If file1 is a directory,
mv copies the entire directory structure onto the destination
file system and deletes the original.
mv cannot be used to perform the following operations:
• Rename either the current working directory or its parent directory using the . or .. notation.
• Rename a directory to a new name identical to the name of a file contained in the same parent
directory.
DEPENDENCIES
NFS
Access control lists of networked files are summarized (as returned in st_mode by stat(2)), but not copied to
the new file. When using mv on such files, a + is not printed after the mode value when asking for permis-
sion to overwrite a file.
Section 1−−554 − 2 − HP-UX Release 11i: December 2000
___
___