Introduction to Linux CP Command Parameters _linux

Source: Internet
Author: User

CP (copy file or directory)

[Root@linux ~]# CP [-ADFILPRSU] source file (source) destination (destination)
[Root@linux ~]# CP [options] Source1 source2 ... d Irectory

Parameters:
-A: equivalent to the meaning of-pdr;
-D: If the source file is a link file attribute (link file), then copy the link file attribute instead of the file itself;
-F: For the purposes of coercion (force), if there are duplicates or other questions, the user will not be asked and forced to copy;
-I: If the destination file (destination) already exists, the overwrite will first ask if the real action!
-L: The link file of the hard link (hard link) is established rather than copying the file itself;
-P: Copies the past along with the attributes of the file, rather than using the preset attributes;
-R: Recursive continuous replication, for directory replication behavior;
-S: Copy to a symbolic link file (symbolic link), or "shortcut" file;

-U: If destination is newer than source destination!
Finally note that if the source file has more than two, then the last destination document must be "directory" to do!

Do not prompt overwrite information overwrite?

\cp-r-F Source Target

The CP command does not prompt overwrite by default, but the CP-I option prompts, while the general Linux start file ~/.BASHRC the CP to

Alias cp= ' Cp-i '

In this way, the input CP command in Linux actually runs Cp-i, plus a "\" symbol that makes the CP command not run using aliases (cp-i).

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.