0

I have multiple directories and each one contains multiple subdirectories. How do I send all subdirectories to the same directory?

  • 1
    The answers [to this question](https://askubuntu.com/questions/86822/how-can-i-copy-the-contents-of-a-folder-to-another-folder-in-a-different-directo) will get you started –  Feb 03 '21 at 17:11

1 Answers1

0

What tool are you using? cp rsync scp

They all have a way to do a "recursive" function

I know with cp you can copy multiple recursive directories pretty easily. With cp you can list 100+ directories or files to copy, and what ever is listed last on your cp command is the destination for all.

cp --help shows

    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.**
...
-R, -r, --recursive          copy directories recursively

Ex:

cp -rv /path/to/copy1 /path/to/copy2 /path/to/copy3 /dest/dir