cp [options] source... destinationArguments explained
- source is what to copy.
- destination is the target path.
- -r copies directories recursively.
- -a preserves mode, ownership, timestamps, and symlinks as much as possible.
- -i asks before overwriting.
Common examples
cp report.txt report-backup.txtCreates a separate backup copy.
cp -a ~/documents /mnt/backup/Preserves metadata better than a plain recursive copy.
| Field | Details |
|---|---|
| Command | cp |
| Category | File and Folder Operations |
| Primary use | Copies files and directories. |
| Syntax | cp [options] source... destination |