With this command
find . -name '*.zip' -exec unzip '{}' ';'
we find all zip files under . (directory), then unzip them into the current working directory, However, the structure is gone.
/backUp/pic1/1-1.zip
/backUp/pic1/1-2.zip
/backUp/pic2/2-1.zip
/backUp/pic2/2-2.zip
/backUp/pic3/3-1.zip
/backUp/pic3/3-2.zip
/backUp/pic3/3-3.zip
Current command result:
/new/1-1
/new/1-2
/new/2-1
/new/2-2
/new/3-1
/new/3-2
/new/3-3
desired result
/new/pic1/1-1
/new/pic1/1-2
/new/pic2/2-1
/new/pic2/2-2
/new/pic3/3-1
/new/pic3/3-2
/new/pic3/3-3
Asked here, but the code doesn't work out What should dirname and basename be in this command?