cp
cp is a UNIX command for copying files and directories. The command has three principal modes of operation, expressed by the types of arguments presented to the program for copying a file to another file, one or more files to a directory, or for copying entire directories to another directory.[1]
- GNU Coreutils [EN] @ Fedora Package
- GNU Coreutils [EN] @ Homebrew Formula
Documentation
- cp [EN] @ GNU Coreutils Manual
Syntax
cp [PARAMETER ...] SRC DST
cp [PARAMETER ...] SRC [...] DIR
Parameters
- -f, --force
- If an existing destination file cannot be opened, remove it and try again.
- -l, --link
- Link files instead of copying.
- -P, --no-dereference
- Never follow symbolic links.
- -r, -R, --recursive
- Copy directories recursively.
- -t DIRECTORY, --target-directory=DIRECTORY
- Copy all SOURCE arguments into DIRECTORY.
- -s, --symbolic-link
- Make symbolic links instead of copying.
- -u, --update
- Copy only when the source file is newer than the destination file or when the destination file is missing.