gtpo1m5pOperations

ZFILE cp-Copy a File or Directory

Use this command to copy a file or directory.

Requirements and Restrictions

Format




-f
forces existing files to be overwritten regardless of the access permissions that are set.
Note:
This parameter does not override the access permissions for a parent directory; that is, if the access permissions for the parent directory of the specified file do not allow write authority, the -f parameter is ignored and the specified file will not be copied. In addition, an error message is not issued if the copy is unsuccessful.

-p
preserves modification and access times, access permissions, and owning user and group IDs.

-r
recursively copies the specified file or directory. If you specify a directory, all files and subdirectories under that directory are copied. (This parameter is equivalent to the -R parameter.)

-R
recursively copies the specified file or directory. If you specify a directory, all files and subdirectories under that directory are copied. (This parameter is equivalent to the -r parameter.)

sourcefile
is the path name of the source file whose contents you are copying.

source
is the path name of the source file or directory whose contents you are copying.

target
is the path name of the file or directory to which you are copying the contents of the source file or directory. If you specify a directory, the contents of each source file or directory are copied to that directory with names specified by the last component of the source path name. If you specify a directory, the directory must exist. If you specify a file that does not exist, the file is created.

Additional Information

Examples

In the following example, test.file is copied to another directory called /newdir, creating a file with path name /newdir/test.file.

+---------------------------------------------------------------------------------------------+
|User:   ZFILE cp test.file /newdir                                                           |
|                                                                                             |
|System: FILE0003I 15:31:22 cp test.fil... COMPLETED SUCCESSFULLY.  NO OUTPUT TO DISPLAY      |
+---------------------------------------------------------------------------------------------+

Related Information

See Information Technology--Portable Operating System Interface for Computer Environments (POSIX) for more information about the POSIX standards.