Skip to content

Instantly share code, notes, and snippets.

@cmcginty
Last active October 5, 2020 03:14
Show Gist options
  • Save cmcginty/ef5d774e7570c0027487312e89d05ab7 to your computer and use it in GitHub Desktop.
Save cmcginty/ef5d774e7570c0027487312e89d05ab7 to your computer and use it in GitHub Desktop.
Zip and 7z Cookbook

List all ZIP files and their uncompressed size in a dir

find "$(pwd)" -name *.zip | while read -r; do 
  echo -n "$REPLY\t"; 
  unzip -l $REPLY | tail -1 | awk '{print $1}'; 
done

List all 7z files and their uncompressed size in a dir

find "$(pwd)" -name *.7z | while read -r; do 
  echo -n "$REPLY\t";
  7z l $REPLY | tail -1 | awk '{print $3}'; 
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment