Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a zipped folder which contains thousands of zipped folders contained in itself and that goes down the hierarchy, I have to unzip each and every file and place it in a single folder.

This task is platform independent either in linux or on windows.

Your help would be highly appreciated. Thankyou.

share|improve this question
add comment

1 Answer

I tried it the quick and dirty way and it worked for me. Create a script:

#!/bin/bash
function rec_unzip {
unzip $1 && rm $1
for i in $(find . -name "*.zip"); do
    if [ -f $i ]
    then
         rec_unzip $i
    fi
done
}
rec_unzip $1

execute the script with ./script_name.sh first_zip_file.zip.

You are free to modify it to supply target directories to unzip.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.