Search code examples
zipunzip

Script to extract zip files in seperate folders to their own folders


I have hundreds of folders each containing a zip file. I would like to extract each zip file to where they are located. Is there a simple trick or script to do this?

EDIT:

Each folder is under the same parent folder. So the hierarchy is as the following:

PARENT FOLDER
-SubFolder1
--somefile.zip
-Subfolder2
--somefile.zip
...
-SubfolderN
--somefile.zip

Solution

  • Under unix you could use something like

    find <dir> -iname '*.zip' -execdir unzip {} \;

    The program find traverses <dir> recursively and on every .zip file it finds it will change to that files directory and executes unzip on it.