Recursively unzip all files in directory

To create subdirectory for each zip file and keep relative structure

with 7z:

7z x '*.zip' -o'*' -p'password'

with unzip:

find . -name "*.zip" | xargs -P 5 -I fileName sh -c 'unzip -o -d "$(dirname "fileName")/$(basename -s .zip "fileName")" "fileName"'

The following command keeps only relative structures of directories, unzipping all files directly

find . -name "*.zip" | xargs -P 5 -I fileName sh -c 'unzip -o -d "$(dirname "fileName")" "fileName"'


Leave a Reply

Your email address will not be published. Required fields are marked *