Lets say that I have the following directory tree structure:
./Original
├── Dir1
│ ├── Objects
│ └── Textures
├── Dir2
│ ├── SubDir1
│ │ └── SubSubDir1
│ │ ├── Objects
│ │ └── Textures
│ └── SubDir2
│ ├── Objects
│ └── Textures
└── Dir3
├── Objects
├── SubDir1
│ ├── Objects
│ └── Textures
└── Textures
And I also have a similar structure (it is actually a copy of the Original Directory without the Objects and Textures directories:
./Copy
├── Dir1
├── Dir2
│ ├── SubDir1
│ │ └── SubSubDir1
│ └── SubDir2
└── Dir3
└── SubDir1
How do I move all of the Objects and Textures directories and their files from the original to the corresponding position in the Copy Directory? It should look like this when complete:
./Original
├── Dir1
├── Dir2
│ ├── SubDir1
│ │ └── SubSubDir1
│ └── SubDir2
└── Dir3
└── SubDir1
./Copy
├── Dir1
│ ├── Objects
│ └── Textures
├── Dir2
│ ├── SubDir1
│ │ └── SubSubDir1
│ │ ├── Objects
│ │ └── Textures
│ └── SubDir2
│ ├── Objects
│ └── Textures
└── Dir3
├── Objects
├── SubDir1
│ ├── Objects
│ └── Textures
└── Textures
Things to notice:
- Not all directories in the Original Directory has Objects and Textures directories
- The Objects and Textures Directories are moved and not copied
- Also the Original and Copy directories are in the same directory and this is where the command/function should be called
Please use this command to build the starting structure:
mkdir -p Original/Dir1/Objects Original/Dir1/Textures Original/Dir2/SubDir1/SubSubDir1/Objects Original/Dir2/SubDir1/SubSubDir1/Textures Original/Dir2/SubDir2/Objects Original/Dir2/SubDir2/Textures Original/Dir3/Objects Original/Dir3/Textures Original/Dir3/SubDir1/Objects Original/Dir3/SubDir1/Textures
mkdir -p Copy/Dir1 Copy/Dir2/SubDir1/SubSubDir1 Copy/Dir2/SubDir2 Copy/Dir3/SubDir1