0

I have folder "F A" containing some subfolders and files and another folder "F B" containing the same folder structure but no file:

find . -type d
.
./F A
./F A/SF A
./F A/SF B
./F A/SF C
./F B
./F B/SF A
./F B/SF B
./F B/SF C

How can I write a mv command to move any file under "F A" to its equivalent folder in "F B"?

find . -type f -exec mv {} "./F B" \; 

will just mv any file under "F A" to "F B", but not in its correct subfolder.

1 Answer 1

2

You need to specify the relative path twice:

find ./FolderA -type f -exec mv "{}" "./FolderB/{}" \; 
0

You must log in to answer this question.