Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

User Commands (m - o) mv(1)
Environment Variables
The following environment variables affect the execution of the mv command:
LC_MESSAGES
Determines the locales equivalent of y or n (for yes/no queries).
UTILSGE Species that HP extensions to the root directory should be omitted when the ini-
tial directory is root and a recursive operation occurs in an OSS shell command.
Application programs that test this variable might also honor its settings.
The UTILSGE value can be any of the following:
NOE Omit the /E directory.
NOG Omit the /G directory.
NOG:NOE Omit both the /G and /E directories.
The effect of assigning a value to UTILSGE environment variable is the same
as specifying the -W NOG or -W NOE ag in the command.
EXAMPLES
1. To rename a le, enter:
mv le1 le2
This renames le1 to le2.Ifale named le2 already exists, its old contents are
replaced with those of le1.
2. To move a directory, enter:
mv dir1 dir2
This moves dir1 to dir2. It moves all les and directories under dir1 to the directory
named dir2, if the second directory exists. Otherwise, the directory dir1 gets renamed
dir2.
3. To move a le to another directory and give it a new name, enter:
mv le1 dir1/le2
This moves le1 to dir1/le2. The name le1 is removed from the current directory, and
the same le appears as le2 in the directory dir1.
4. To move a le to another directory, keeping the same name, enter:
mv le1 dir1
This moves le1 to dir1/le1.
5. To move several les into another directory, enter:
mv le1 dir1/le2 /u/dir2
This moves le1 to /u/dir2/le1 and dir1/le2 to /u/dir2/le2.
6. To use mv with pattern-matching characters, enter:
mv dir1/* .
This moves all les in the directory dir1 into the current directory (.), giving them the
same names they had in dir1. This also empties dir1. Note that you must type a space
527188-003 Hewlett-Packard Company 627