Summary of cp commands in linux

Source: Internet
Author: User
Cp summary function description: copy a file or directory syntax: cp [parameter] source file directory target file or directory this command is used to copy one or more files to the target Directory Supplement: the Cp command is used to copy files or directories. for example, if you specify more than two files or directories at the same time, and the final destination is... information & n

 

Cp summary

Function description: copy a file or directory

 

Syntax: cp [parameter] source file directory target file or directory

 

This command is used to copy one or more files to the target directory.

 

Note:

 

The Cp command is used to copy files or directories. for example, if you specify more than two files or directories at the same time, and the final destination is an existing directory, then it copies all the previously specified files or directories to this directory. If multiple files or directories are specified at the same time, and the last destination is not an existing Directory, an error message is displayed.

 

Parameters:

 

-A or-archive: the effect of this parameter is the same as that of the "-dpR" parameter.

 

-B or-backup is deleted to overwrite the backup before the target file. a backup string is added at the end of the backup file.

 

-D or-no-dereference when a symbolic connection is copied, the target file or directory is also established as a symbolic connection and points to the original file working directory connected to the source file or directory.

 

-F or-force forcibly copies files or directories, whether or not the target file or directory already exists

 

-I or-interactive ask the user before overwriting existing files.

 

-L or-link establishes a hard connection to the source file instead of copying the file.

 

-P or -- preserve retains the properties of the source file or directory

 

-P or-parents retains the path of the source file or directory

 

-R recursive processing: processes files in a specified directory along with subdirectories

 

Recursive processing: all files in a specified directory are processed together with subdirectories.

-S or -- symbolic-link establishes a symbolic connection to the source file instead of copying the file.

-S <备份字尾字符串> Or -- suffix = <备份字尾字符串> After you use the "-B" parameter to back up the target file, a backup string is added at the end of the backup file. the default backup string is the symbol "~ ".

-U or -- update when this parameter is used, the file will be copied only when the source file is updated later than the target file or the target file with the corresponding names does not exist.

-V or -- verbose displays the command execution process.

-V <备份方式> Or -- version-control = <备份方式> After you use the "-B" parameter to back up the target file, a backup string will be added at the end of the backup file. this string can be changed not only by the "-S" parameter, when you use the "-V" parameter to specify different backup methods, different backup strings are generated.

-X or -- one-file-system: the file system in which the file or directory is copied must be the same as the file system in which the cp command is executed; otherwise, the file system will not be copied.

-- Help online help.

-- Sparse = <使用时机> Set the time to save sparse files.

-- Version: displays the version information.

 

From the column zhaoxinglei0309

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.