Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (c) cp(1)
c. To copy all files in a directory and preserve their modification 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 files 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 filenames resulting from this copy are truncated to the first eight
characters. Characters in the OSS filenames that are illegal to the Guardian file
system are skipped during the renaming process. The specified target volume
must exist in the Guardian environment.
f. To copy a Guardian file to an OSS directory, enter:
cp /G/vol/subvol/file /usr/bin
g. To copy the files 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 file1 (a plain text file) and also rose1 (a subdirectory), the
cp command creates the subvolume rose in /G/vol and copies only the file file1.
The subtree rose1 is not copied. The destination volume must exist in the Guar-
dian environment.
h. To copy all OSS files 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 files 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 files or between local and
remote files. You can use the -W NOG and -W NOE flags or the UTILSGE environment vari-
able to exclude objects in the Guardian file system or objects accessible through the Expand pro-
duct.
RELATED INFORMATION
Commands: mv(1).
STANDARDS CONFORMANCE
The -L and -W flags and the UTILSGE environment variable are HP extensions to the XPG4
Version 2 specification.
527188-003 Hewlett-Packard Company 2−71