Specifications

Version 2.0
93
cp
Summary
Copies one or more source files or directories to a destination.
Usage
cp [-r] [-q] src [src...] [dst]
Options
src
Source file/directory name (wildcards are permitted)
dst
Destination file/directory name (wildcards are not permitted). If not specified,
then the current working directory is assumed to be the destination. If there are
more than one directory specified, then the last is always assumed to be the
destination.
-r
Recursive copy.
-q
Quiet copy (no prompt)
Description
This command copies one or more source files or directories to a destination. If the
source is a directory, the -r flag must be specified. If -r is specified, then the source
directory will be recursively copied to the destination (which means that all
subdirectories will be copied). If a destination is not specified, then the current
working directory is assumed to be the destination.
If any target file (not directory) already exists, there will be a prompt asking the user
to confirm replacing the file. The following four choices are available:
Yes: Replace the file.
No: Do not replace the file.
All: Replace the existing files in all subsequent cases.
Cancel: Do not replace any existing files in all subsequent cases.
If there are multiple source files/directories, the destination must be a directory.
If an error occurs, then the copying process will stop immediately.
When executing in a script, the default is –q.