m
mv(1) | mv(1) |
If
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 equivalent of y (for yes/no queries).
LANG determines the language in which messages are displayed.
If LC_CTYPE is not speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed 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 ®le in the current directory:
mv
Rename a directory in the current directory:
mv
Rename a ®le in the current directory whose name starts with a nonprinting control character or a character that is special to the shell, such as - and * (extra care may be required depending on the situation):
Move directory sourcedir and its contents to a new location (targetdir) in the ®le system (upon completion, a subdirectory named sourcedir resides in directory targetdir):
mv sourcedir targetdir
Move all ®les and directories (including links) in the current directory to a new location underneath tar- getdir:
mv * targetdir
Move all ®les 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 ®le1 and
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 ®le contained in the same parent directory.
DEPENDENCIES
NFS
Access control lists of networked ®les are summarized (as returned in st_mode by stat(2)), but not copied to the new ®le. When using mv on such ®les, a + is not printed after the mode value when asking for permission to overwrite a ®le.
Section 1−554 | − 2 − |