Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


cp command (copies a file or directories)

Organization of this page

Format

cp [-f|-i] [-p] [-R|-r [-H|-L|-P]] copy-source-file-name copy-target-file-name
cp [-f|-i] [-p] [-R|-r [-H|-L|-P]] copy-source ... copy-target-directory-name

Description

The command copies files or directories.

Arguments

-f

Specifies that no warning is to be issued if the target file will be overwritten. When the -f and -i options are both specified, the one specified last takes effect.

-i

Specifies that if the target file will be overwritten, a warning is to be issued asking the user to confirm the copy processing. Copying will be performed if the response from the standard input begins with the letter y or Y. If the response begins with any other character, or if the standard input is not available, processing is interrupted and the command terminates with a return code of 0.

When the -f and -i options are both specified, the one specified last takes effect.

-p

Specifies that the attributes of the copy source file are to be kept intact (preserved).

In Windows, the most recent modification date and time and the most recent access date and time of the source file are preserved, but directory information is not preserved.

In UNIX, the owner, group, access permissions, last modification date and time, and last access date and time of each source file are preserved.

-R|-r

Specifies that directories are to be copied recursively.

-H

In UNIX, when the -R or -r option is specified, specifies that symbolic links on the command line are to be followed.

Symbolic links encountered while traversing the tree are not followed.

This option is ignored if neither the -R nor the -r option is specified. If more than one of the -H, -L, and -P options is specified, the one specified last takes effect.

In Windows, this option is ignored.

-L

In UNIX, when the -R or -r option is specified, specifies that all symbolic links that are encountered are to be followed.

This option is ignored if neither the -R nor the -r option is specified. If more than one of the -H, -L, and -P options is specified, the one specified last takes effect.

In Windows, this option is ignored.

-P

In UNIX, when the -R or -r option is specified, specifies that symbolic links are not to be followed.

This option is ignored if neither the -R nor the -r option is specified. If more than one of the -H, -L, and -P options is specified, the one specified last takes effect.

In Windows, this option is ignored.

copy-source-file-name

Specifies the name of the file to be copied.

copy-target-file-name

Specifies the name of the target file into which the source file's contents are to be copied.

copy-source

Specifies a file or directory to be copied.

copy-target-directory-name

Specifies the directory into which the copy source's contents are to be copied.

Return codes

Return code

Meaning

0

Normal termination

1 or greater

Error termination

Notes

Usage examples