File Operations
cp
Copies files or directories. Creates an exact copy of the source file at the destination.
Ubuntu
CentOS
Debian
Arch
SUSE
Slackware
Fedora
Verified: 2025-09-09
Syntax
$cp [OPTIONS] SOURCE DEST
Optionen
-r, --recursive
Copy directories recursively
-i, --interactive
Ask before overwriting
-v, --verbose
Show copied files
-p, --preserve
Preserve permissions and timestamps
-a, --archive
Like -p plus recursive and preserve links
-f, --force
Overwrite without prompt
-u, --update
Copy only newer files
Examples
$cp file.txt file_copy.txt
$cp -r folder/ new_folder/
$cp -i important_file.txt backup.txt
$cp -v *.txt /backup/
$cp -p file.txt copy.txt
Typical use cases
?
Standard usage
cp --help
Note
Reliable tool for file copies. For large data, <code>rsync</code> is more efficient. See also <code>scp</code> for network copies.
Export