The “cp” command

Use this command to copy one or more files or directories.

To copy a file, include any “<OPTION” variables along with the “<SOURCE>” path and filename of the file to copy. You can include multiple “<SOURCE>” file entries with a whitespace. Include the "<DIRECTORY>” for the file destination.
Note: You can use absolute or relative paths, so long as they resolve within the same top-level directory.
Command format:
This example copies two files from a test directory into a release directory while preserving their attributes.
cp -p /123456/test/movie1.mp4 /123456/test/movie2.mp4 /123456/release/
Important: Operations are restricted to existing directory trees

Your destination <DIRECTORY> must use a pre-existing path, as this command doesn't create a non-existent directory. For example, because the “non-existent” directory doesn't exist, this command will fail: cp /123456/movie.mp4 /123456/non-existent/

Available options

The “<OPTION>” variable displayed in the above examples can be populated with any of the following options:

Option Description
-i, --interactive Ask before overwriting existing files.
-p, --preserve Copy the attributes for each file, as well.
-r Use recursion, creating files from non-directories.
-v, --verbose Display the operation’s execution step by step.
-h, --help Display help information for this command.