With this command, we can recursively unzip archives in a directory and its sub-directories and remain its structure in the current working directory.
find ../backUp/ -name "*.zip" |
xargs -P 5 -I fileName sh -c '
unzip -o -d "$(dirname "fileName")/$(basename -s .zip "fileName")" "fileName"
'
But when I run it, all the unzipped folders keep in the original directory. Can we hard-code basename and dirname in the bash environment?
adding example:
/backUp/pic1/1.zip
/backUp/pic2/2.zip
/backUp/pic3/3.zip
Goal:
/new/pic1/1-1.png
/new/pic1/1-2.png
/new/pic2/2-1.png
/new/pic2/2-2.png
/new/pic3/3-1.png