Skip to content

Instantly share code, notes, and snippets.

@tyrcho
tyrcho / recunzip.sh
Last active November 27, 2023 16:40
recursively unzip jar, war, ear files
#inspired by http://unix.stackexchange.com/questions/4367/extracting-nested-zip-files
while [ "`find . -type f -name '*.?ar' | wc -l`" -gt 0 ]; do 1 ↵
find . -type f -name "*.?ar" \
-exec mkdir -p '{}.dir' \; \
-exec echo "unzipping "{}" to "{}".dir" \; \
-exec unzip -o -d '{}.dir' -- '{}' \; \
-exec rm -- '{}' \;;
done