Linux Copy file CP

Source: Internet
Author: User

CP Option Description

Syntax: CP [option] source file or directory destination file or directory

Note: This command copies the specified source files to the destination file or copies multiple source files to the destination directory.

The options for this command have the following meanings:

-A This option is typically used when copying a directory. It retains links, file attributes, and recursively copies the directory, which is equal to the combination of the DPR option.

-Keep links when copying D.

-F Delete a target file that already exists without prompting.

-I and F options, in contrast, will prompt the user for confirmation before overwriting the target file. Answer y when the target file will be overwritten, is an interactive copy.

-P At this point, the CP will also copy the modified time and access rights to the new file in addition to the contents of the source file.

-R If the source file is a directory file, the CP will recursively replicate all subdirectories and files in that directory. The destination file must be a directory name at this time.

-L do not make copies, just link files.

--------------

CP-RF/var/www/usr/local/apache2/htdocs

www This directory was copied under Htdocs, and the name is also this directory www.

And in fact, what I want is the www file under Htdocs.

This solution is OK:

CP-RF/var/www/*  /usr/local/apache2/htdocs/

Linux Copy file CP

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.