Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Copying files within the z/OS UNIX file system z/OS UNIX System Services User's Guide SA23-2279-00 |
|
You can use the shell commands cp or pax or the TSO/E command OCOPY to copy files within the z/OS UNIX file system. Using the shell: Use the cp shell
command to copy:
To copy one file to another file in the working directory, enter:
This command copies the contents
of file1 into file2. To copy a list of files into another directory, enter:
This
command copies the files file1, file2, file3 into
the directory dir1. For further information about the cp command, see z/OS UNIX System Services Command Reference. You can use the pax shell command in copy mode to copy a set of directories and files to another place in your file system. To use pax in copy mode, specify the -r and -w (or -rw)
options, as follows:
pax reads
the specified path name and copies it to the target directory. The
target directory must already exist and you must have write access
to it. If a path name is a directory, pax copies
all the files and subdirectories in that directory, as well as the
directory itself, to the target directory. Using pax in copy mode with additional options such as -C and -M can be useful for migrating data from one file system type to another (for instance, from HFS to zFS). For further information about the pax command, see the pax command description in z/OS UNIX System Services Command Reference. Using TSO/E: You can use the TSO/E OCOPY command to copy a z/OS UNIX file to another z/OS UNIX file and, in the process, convert the data from one code page to another. Example: To copy a z/OS UNIX file to another z/OS UNIX file in a different
directory, converting the data:
The combination of CONVERT((BPXFX311)) and TO1047 indicates that you want to use the ASCII conversion table to convert from ASCII to code page IBM-1047. TO1047 or FROM1047 is required if CONVERT is specified. With the CONVERT parameter, you can specify a data set name, a member name, or both. In this example, the use of (( )) with no data set name indicates that you are specifying a member that is a module in the standard search order for MVS™. If the files that are being allocated are new files, the PATHOPTS and PATHMODE operands are required. |
Copyright IBM Corporation 1990, 2014
|