SEARCH_DIR="$1:-." OVERWRITE="" DELETE_AFTER=false

find . -name "*.zip" -type f -exec unzip -o {} -d {}/.. \;

| Component | Purpose | |-----------|---------| | find | Recursively traverse directory tree | | -name "*.zip" | Match files ending in .zip (case-sensitive; use -iname for case-insensitive) | | -type f | Restrict to regular files (excludes directories named .zip ) | | -execdir | Execute the command the file’s containing directory | | unzip -o | Extract, overwriting existing files without prompting | | {} \; | Placeholder for matched file; terminator for -execdir |

| Method | Best for | Handles spaces in names | Performance | |--------|----------|------------------------|--------------| | find -exec | Most everyday use | Yes | Moderate | | find + xargs | Thousands of ZIPs | Yes (with -print0 ) | High | | Bash loop | Custom logging/conditional logic | Yes (with proper quoting) | Moderate |

find /path/to/root -type f -iname '*.zip' -print0 | xargs -0 -n1 -P4 -I{} sh -c 'unzip -q "{}" -d "$(dirname "{}")"'

unzip all files in subfolders linux
; ; ;