Skip to content

Instantly share code, notes, and snippets.

@MLKrisJohnson
Created February 2, 2017 19:38
Show Gist options
  • Save MLKrisJohnson/6836085e4add9579d2ab51e0e5370ff6 to your computer and use it in GitHub Desktop.
Save MLKrisJohnson/6836085e4add9579d2ab51e0e5370ff6 to your computer and use it in GitHub Desktop.
Bash/zsh function to unzip a set of files to a set of directories
# Unzip a set of files to archive-specific directories
# Example: unz *.zip
unz() {
if [ -z "$1" ]; then
echo 'usage: unz FILE...'
else
for file in "$@"; do
/usr/bin/unzip -d "$file.unz" "$file"
done
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment