$ cp
Copy files and directories
DOCUMENTEDFiles & directoriesUbuntu 24.04 LTS baseline
Synopsis
cp [OPTION]... SOURCE... DIRECTORY
What it does
- `cp` copies SOURCE to DESTINATION.
- Use `-r`/`--recursive` when copying directories.
Examples
Copy a file
cp file.txt backup.txtCopy a file into a directory
cp file.txt backups/Copy a directory recursively
cp -r project/ project-backup/Important details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.