Skip to content

Instantly share code, notes, and snippets.

@emraher
Created March 19, 2016 08:44
Show Gist options
  • Save emraher/d342e01a98b9e23a0c98 to your computer and use it in GitHub Desktop.
Save emraher/d342e01a98b9e23a0c98 to your computer and use it in GitHub Desktop.
Recursively unzip
#
# I used this command to recursively unzip the files I downloaded from PRISM.
# Data is structured as
#
# tmin
# -- 1981
# ----xxx.zip
# ----xxy.zip
# -- 1982
# ----xxx.zip
# ----xxy.zip
#
# I wanted to extract all zips in their corresponding folders and then delete the zip files.
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; rm "$filename"; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment