Linux CP Command Detailed

Source: Internet
Author: User

CP Common Command parameters
USAGE:CP [OPTION] ... [-T] SOURCE DEST OR:CP [OPTION] ... SOURCE ... Directory OR:CP [OPTION] ...-t DIRECTORY SOURCE ... Copy source to DEST, or multiple source (s) to DIRECTORY.  Mandatory arguments to long options is Mandatory for short options too. -A,--archive same as-dr--preserve=all--backup[=control] Make a backup of each existing Desti  Nation file-b like--backup but does don't accept an argument--copy-contents copy Contents of special files when recursive-d same as--no-dereference--preserve=links-f,--f Orce If an existing destination file cannot be opened, remove it and try Again (redundant if the-n option is used)-I,--interactive prompt before Ove  Rwrite (Overrides a previous-n option)-H Follow command-line Symbolic Links In Source-l,--link link files instead of copying-l,--dereference always follow Symboli                                 C links in Source-n,--no-clobber does not overwrite an existing file (Overrides                           A previous-i option)-P,--no-dereference never follow symbolic links in Source-p                                 Same as--preserve=mode,ownership,timestamps--preserve[=attr_list] preserve the specified attributes (default: Mode,ownership,timestamps), if possible additional attribute      S:context, links, xattr, all-c same as--preserve=context  --no-preserve=attr_list don ' t preserve the specified attributes--parents use full source file name Under Directory-r,-R,--recursive copy directories recursively--reflink[=when] control Clone/co W copies.    See below.  --remove-destination Remove each existing destination file before attempting to open It (contrast with--force)--sparse=when control creation of sparse files.      See below. --strip-trailing-slashes remove any trailing slashes from each SOURCE argument-s,--sym  Bolic-link make symbolic links instead of copying-s,--suffix=suffix override the usual backup suffix -T,--target-directory=directory Copy all SOURCE arguments to Directory-t,--no-target-directory treat DEST as a  Normal file-u,--update copy only if the SOURCE file is newer than the Destination file or when the destination file is Missing-v,--verbose ex  Plain what are being done-x,--one-file-system stay on the This file system-z,--context=context set security Context of Copy to CONTEXT--helP Display this Help and exit--version output version information and exit 
Common Command Display

CP: Copy command

-A keeps the original property-R recursive copy-P: Hold Property

Cp-a/home/omc/h.txt/root/    Preserve Original properties

Force Copy Command

-RF Forced recursive replication

  /bin/cp–rf/home/omc/h.txt/root/h.txt   system default is call alias, plus absolute path after execution, execute system command  ==> cp–rf/home/omc/h.txt/root/       

Create a linked file

Cp-s qq.sh qq_link.sh "Show L represents a linked file, while permission is 777"

Linux CP Command Detailed

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.