Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

User Commands (c) cp(1)
c. To copy all les in a directory and preserve their modication times, enter:
cp -p dir1/* dir2
d. To copy a directory tree to another directory, enter:
cp -R dir1 dir2
The dir1 directory tree is created in the directory dir2.
e. To copy all les with a name ending in the letter c from the current OSS direc-
tory to Guardian $VOL.SUBVOL, enter:
cp . /*c /G/vol/subvol
The Guardian lenames resulting from this copy are truncated to the rst eight
characters. Characters in the OSS lenames that are illegal to the Guardian le
system are skipped during the renaming process. The specied target volume
must exist in the Guardian environment.
f. To copy a Guardian le to an OSS directory, enter:
cp /G/vol/subvol/le /usr/bin
g. To copy the les in an OSS directory named /usr/u/rose to the Guardian volume
/G/vol,enter:
cp -r /usr/u/rose /G/vol
If /usr/u/rose contains le1 (a plain text le) and also rose1 (a subdirectory), the
cp command creates the subvolume rose in /G/vol and copies only the le le1.
The subtree rose1 is not copied. The destination volume must exist in the Guar-
dian environment.
h. To copy all OSS les on remote node node1 to remote node node2,enter:
cp -r -W NOG /E/node1 /E/node2
This command creates the directory tree named node1 within the root directory
of node2.
i. To copy all OSS les on the local node to the remote node node1,enter:
cp -r -W NOG -W NOE / /E/node1
NOTES
Because /G and /E both appear in your local root directory, you should be very careful when
using OSS shell commands on or from the root directory. OSS shell commands that perform
recursive actions make no distinction between Guardian and OSS les or between local and
remote les. You can use the -W NOG and -W NOE ags or the UTILSGE environment vari-
able to exclude objects in the Guardian le system or objects accessible through the Expand pro-
duct.
RELATED INFORMATION
Commands: mv(1).
STANDARDS CONFORMANCE
The -L and -W ags and the UTILSGE environment variable are HP extensions to the XPG4
Version 2 specication.
527188-004 Hewlett-Packard Company 271