Linux Replication Directory error cp:omitting directory solution

Source: Internet
Author: User

Copy directory to another directory in Linux system, error when using CP command

1, in the/home/directory, create a new directory, such as: 123

2, copy directory 123 to the/tmp/directory, using the CP command

3, the system error, cp:omitting directory ' 123 '

4, using the Cp-r command to replicate (note: CP command By default can not replicate the directory, need to add parameter-R).

5, view copy results, directory 123 has been replicated successfully.

6, note: CP parameters

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

-D Keep links when copying.

-F Deletes an existing destination file without prompting.

-I and F options, in contrast, will be prompted to confirm the user before overwriting the target file. When you answer y, the target file is overwritten and is an interactive copy.

-P In addition to copying the contents of the source file, the CP will also copy the modification time and access rights to the new file.

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

-L do not copy, just link file.


1, the CP-A command can also complete directory replication.

2, Format cp-r directory name new directory name.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.