[Linux] cp:omitting directory ' XXX ' problem solving

Source: Internet
Author: User

When you copy a folder on a Linux system, you are prompted as follows:

Shell:

  1. cp:omitting directory ' foldera/'

Where Foldera is the name of the folder I want to copy, the reason for this warning is that the directory still exists under the Foldera directory, so it cannot be copied directly.

Workaround: Using a recursive copy, add the-r parameter after the CP command, as follows:

Shell:

  1. [Email protected] opt]# cp-r Foldera FOLDERC

The-R here represents the meaning of recursion.

Similarly, when we delete the directory under the Linux system, we also need to add the-r parameter, if the directory is empty, it will be deleted directly, if the directory is not empty, it will be cascade deleted. However, there is also a problem when cascading delete is that if there are many files or subdirectories under the directory, the system will be prompted one at a time. You can use the RM-RF command if you want to remove it without prompting. F is force's meaning, represents mandatory deletion, no hint!

[Linux] cp:omitting directory ' XXX ' problem solving

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.