#!/usr/bin/env bash # Get gzipped file size # USAGE: gz origsize=$(wc -c < $1) gzipsize=$(gzip -c "$1" | wc -c) ratio=$(echo $(( $gzipsize * 100 / $origsize ))) echo "Original: $origsize bytes" echo "Gzipped: $gzipsize bytes ($ratio%)"