Jump to content

cp

From RaySoft

cp is a shell command for copying files and directories.[1]

Documentation

Syntax

cp [PARAMETER ...] SRC DST
cp [PARAMETER ...] SRC [...] DIR

Parameters

General
The following parameters can be used with all version of cp:
NOTE:
The BSD version only supports the short form (e.g. -f) of these parameters!
-f, --force
If an existing destination file cannot be opened, remove it and try again.
-l, --link
Hard link files instead of copying.
-P, --no-dereference
Never follow symbolic links in SRC.
-r, -R, --recursive
Copy directories recursively.
-s, --symbolic-link
Make symbolic links instead of copying.
GNU
The following parameters can be used with the GNU version of cp:
-t DIRECTORY, --target-directory=DIRECTORY
Copy all SRC arguments into DIRECTORY.

References

  1. Wikipedia contributors. "cp (Unix)." Wikipedia. https://en.wikipedia.org/wiki/Cp_(Unix) (accessed 18.08.2025)