Skip to content

Instantly share code, notes, and snippets.

@aabccd021
Last active July 21, 2025 01:33
Show Gist options
  • Save aabccd021/772ca309a353e96d94e36ce24411d6fa to your computer and use it in GitHub Desktop.
Save aabccd021/772ca309a353e96d94e36ce24411d6fa to your computer and use it in GitHub Desktop.
file=$1
outdir=$(mktemp -d)
printf "original: "
ls -l "$file" | awk '{print $5}'
nix run nixpkgs#gzip -- -9 -c "$file" > "$outdir/file.gzip"
printf "gzip: "
ls -l "$outdir/file.gzip" | awk '{print $5}'
nix run nixpkgs#zstd -- -19 -q -c "$file" > "$outdir/file.zstd"
printf "zstd: "
ls -l "$outdir/file.zstd" | awk '{print $5}'
nix run nixpkgs#brotli -- -9 -c "$file" > "$outdir/file.brotli"
printf "brotli: "
ls -l "$outdir/file.brotli" | awk '{print $5}'
nix run nixpkgs#xz -- -9 -c "$file" > "$outdir/file.xz"
printf "xz: "
ls -l "$outdir/file.xz" | awk '{print $5}'
nix shell nixpkgs#lz4 --command lz4 -9 -c "$file" > "$outdir/file.lz4"
printf "lz4: "
ls -l "$outdir/file.lz4" | awk '{print $5}'
nix run nixpkgs#bzip2 -- -9 -c "$file" > "$outdir/file.bzip2"
printf "bzip2: "
ls -l "$outdir/file.bzip2" | awk '{print $5}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment