The unzip
command doesn\'t have an option for recursively unzipping archives.
If I have the following directory structure and archives:
/Moth
A solution that correctly handles all file names (including newlines) and extracts into a directory that is at the same location as the file, just with the extension removed:
find . -iname '*.zip' -exec sh -c 'unzip -o -d "${0%.*}" "$0"' '{}' ';'
Note that you can easily make it handle more file types (such as .jar
) by adding them using -o
, e.g.:
find . '(' -iname '*.zip' -o -iname '*.jar' ')' -exec ...