Tag Archives: cp: omitting directory

Solutions to CP: organizing directory errors in Linux

Solutions to CP: organizing directory errors in Linux

When copying a folder on the same machine in Linux system, the prompt is as follows:
CP: organizing directory ` foldera/’
where foldera is the name of the folder I want to copy. The reason for this warning is that there is a directory under the foldera directory, so it cannot be copied directly

Solution:
use recursive copy and add the – R parameter after CP command, such as:
[ root@localhost Opt] # CP – R foldera folderc
here ‘- R’ stands for recursion

Similarly, the – R parameter should be added when deleting a directory in Linux system. If the directory is empty, it will be deleted directly. If the directory is not empty, it will be deleted in cascade. However, there is also a problem in cascading deletion, that is, if there are many files or subdirectories in the directory, the system will prompt one by one. If you want to delete it without prompt, you can use the RM – RF command. F is the meaning of force, on behalf of forced deletion, no prompt

Draw inferences from one instance:
1. When Chmod grants permissions, you can also use – r if you want to cascade. Note that it is uppercase R

2. The copy command between different machines is: (- r also uses recursive copy)

scp -r [email protected] :/home/mmm/QTest /home/nnn/

SCP – R login right @ a machine IP:/absolute path name of folder/absolute path to copy to B machine

In this way, a folder is copied from machine a to a certain path of machine B

reference: http://www.linuxdiyf.com/linux/16778.html