Cp command, cp command details

Source: Internet
Author: User

Cp command, cp command details

You can use the cp command to copy files and directories. In addition to copying files, the cp command can also create shortcuts.

Cp (copy a file or directory)

[Root @ www ~] # Cp [-adfilprsu] to use the source object (destination) [root @ www ~] # Cp [options] source1 source2 soure3 .... directory Options and parameters:-a: equivalent to-pdr. For pdr, see the following description. (commonly used)-d: if the source file is a link file ), copy the link file property instead of the file itself.-f: force indicates that the target file already exists and cannot be enabled, and then try again.-I: if the destination file (destination) already exists, when overwriting, the system will first ask the action for (commonly used)-l: to create a hard link file, instead of copying the file itself;-p: Copies the file together with its attributes, rather than using the default attributes (commonly used for backup);-r: recursive continuous replication, used for directory replication; (commonly used)-s: Copies a symbolic link file (symbolic link), that is, a "shortcut" file;-u: Updates dest only when destination is earlier than source. Ination!
When copying a directory, you must add the-r parameter. Remember! Of course, the-a parameter is generally used for directory replication. It includes the-r parameter and will be copied together with the file attributes! Note that if there are more than two source files, the last target file must be a "directory!

 

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.