I have a folder Accounts containing mail accounts, all of these folders have a folder Archive.folder. I want to move all of archive folders with a simple script to a new folder.
I tried this so far:
find . -mindepth 1 -maxdepth 1 ! -name archive -exec mv -t testnew/ {} +
But it moves all folders, not just the ones called archive. I want to find all folders in the current folder called archive and move them to the folder testnew/. The path to the moved folder should be the same as before.
Existing situation:
Accounts
- 1
- archive
- inbox
- folder2
- 2
- archive
- inbox
- folder2
- 3
- archive
- inbox
- folder2
How it should look like:
testnew
- 1
- archive
- 2
- archive
- 3
- archive