Linux Command Reference: cp
The cp command is used to copy files and directories.
Using cp
Usage: cp <options> <source_path> <destination_path>
<source_path> - The path of the file or directory to be copied (the * wildcard may be used to specify all files or directories in a path)
<destination_path> - The path which the specified source files or directories will be copied to
cp Options
- -d - Copy links, as well as regular files
- -f - Force the copy (if a file already exists in the destination path and cannot be opened, copy over it)
- -i - Prompt before overwriting existing files in the destination path
- -L - Always follow symbolic links
- -P - Never follow symbolic links
- -p - Preserve file or directory owner and attributes
- -R or -r - Copy directories and their contents recursively
- -s - Create symbolic links in the destination path instead of copying files
- -u - Copy over files in the destination path only if they are older than the copy from the source path
Help and Manual
Enter cp --help to view the Help file or enter man cp to view the Manual for cp.
Related Commands