-a
|
Copies the file with the same permission settings and metadata as the original.
|
cp -a text.txt /home/user/destinationfolder/
|
--archive
|
Copies the file with the same permission settings and metadata as the original.
|
cp --archive text.txt /home/ user/destinationfolder/
|
-b
|
Creates a copy in the buffer if the original and the destination have the same file name but different contents.
|
cp -b text.txt /home/user/destinationfolder/
|
--backup
|
Creates a copy in the buffer if the original and the destination have the same file name but different contents.
|
cp --backup text.txt /home/user/destinationfolder/
|
--backup=numbered
|
Creates a new numbered file if the original and destination have the same file name but different contents.
|
cp --backup==numbered text.txt /home/user/destinationfolder/
|
--backup=existing
|
Creates a new numbered file if the original and destination have the same file name but different contents – and there are already numbered backups.
|
cp --backup==existing text.txt /home/user/destinationfolder/
|
-d
|
Copies symbolic links.
|
cp -d text.txt /home/user/destinationfolder/
|
-f
|
Forces overwriting when copying.
|
cp -f text.txt /home/user/destinationfolder/text.txt
|
--force
|
Forces overwriting when copying.
|
cp --force text.txt /home/user/destinationfolder/text.txt
|
-i
|
Asks permission before overwriting files with the same name.
|
cp -i text.txt /home/user/destinationfolder/
|
--interactive
|
Asks permission before overwriting files with the same name.
|
cp --interactive text.txt /home/user/destinationfolder/
|
-l
|
Creates a hard link instead of a copy.
|
cp -l text.txt /home/user/destinationfolder/
|
--link
|
Creates a hard link instead of a copy.
|
cp --link text.txt /home/user/destinationfolder/
|
-n
|
Existing files are never overwritten.
|
cp -n text.txt /home/user/destinationfolder/
|
--no-cobbler
|
Existing files are never overwritten.
|
cp –no-cobbler text.txt /home/user/destinationfolder/
|
-p
|
Attributes of the original file are inherited during copying.
|
cp -p text.txt text1.txt
|
--preserve
|
Attributes of the original file are inherited during copying.
|
cp --preserve text.txt text1.txt
|
--preserve=mode
|
The mode of the original file is inherited during copying.
|
cp --preserve==mode text.txt text1.txt
|
--preserve=ownership
|
The ownership of the original file is inherited when it is copied.
|
cp --preserve==ownership text.txt text1.txt
|
--preserve=timestamp
|
The timestamp of the original file is inherited during copying.
|
cp --preserve==timestamp text.txt text1.txt
|
--preserve=links
|
Links of the original file are inherited when copying.
|
cp --preserve==links text.txt text1.txt
|
--preserve=context
|
The security context of the original file is inherited during copying.
|
cp --preserve==context text.txt text1.txt
|
--preserve=xattr
|
Extended attributes of the original file are inherited during copying.
|
cp --preserve==xattr text.txt text1.txt
|
--preserve=all
|
All attributes of the original file are inherited during copying.
|
cp --preserve==all text.txt text1.txt
|
-P
|
Symbolic links are saved as such.
|
cp -P text.txt /home/user/destinationfolder/
|
--no-dereference
|
Symbolic links are saved as such.
|
cp --no-dereference text.txt /home/user/destinationfolder /
|
-r
|
Directories are copied recursively including subdirectories.
|
cp -r /home/user/originalfolder/ /home/user/destinationfolder/
|
-R
|
Directories are copied recursively including subdirectories.
|
cp -R /home/user/originalfolder/ /home/user/destinationfolder/
|
--recursive
|
Directories are copied recursively including subdirectories.
|
cp --recursive /home/user/originalfolder/ /home/user/destinationfolder/
|
-s
|
Creates a symbolic link to the original file.
|
cp -s text.txt /home/user/destinationfolder/
|
--symbolic-link
|
Creates a symbolic link to the original file.
|
cp --symbolic-link text.txt /home/user/destinationfolder/
|
-S
|
Overwrites a backup suffix when copying with --backup.
|
cp --backup=simple -S text.txt /home/user/destinationfolder/
|
--suffix=own_suffix
|
Overwrites a backup suffix with its own term when copying with --backup.
|
cp --backup=simple –suffix=own_suffix text.txt /home/user/destinationfolder/
|
-u
|
Copies the file only if the destination file is older than the original.
|
cp -u text.txt /home/user/destinationfolder/text.txt
|
--update
|
Copies the file only if the destination file is older than the original.
|
cp --update text.txt /home/user/destinationfolder/text.txt
|
-v
|
Outputs a message after the copy operation.
|
cp -v text.txt text1.txt
|
--verbose
|
Outputs a message after the copy operation.
|
cp --verbose text.txt text1.txt
|