Skip to content

Instantly share code, notes, and snippets.

@Hashbrown777
Created February 9, 2020 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hashbrown777/48f842ef92124c447bb87e3b6f3fee02 to your computer and use it in GitHub Desktop.
Save Hashbrown777/48f842ef92124c447bb87e3b6f3fee02 to your computer and use it in GitHub Desktop.
rezip an archive at a higher compression rate with no temp files. reading zip metadata, demo of unzipping/zipping a stream, and deleting/renaming files inside a zip
zipinfo -1 A.zip | while read filename
do
unzip -p A.zip "$filename" | zip -9 A.zip -
zip --delete A.zip "$filename"
printf "@ -\n@=$filename\n" | zipnote -w A.zip
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment