Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# note: this won't work too well with filenames/directories with spaces in them
function compressresource() {
gzip -c9 "$1" > "$1.gz"
touch -c -r "$1" "$1.gz"
echo "Compressed: $1 > $1.gz"
}