>_ IzzyLab

Topic breakdown

In gzip the compression level is set by a digit from -1 (fast and weaker) to -9 (slow and stronger), with -6 by default — a trade-off between CPU time and result size. An important interface feature: by default gzip consumes the source and invents a .gz name itself, so to keep the original and use an arbitrary output name you need the stdout output mode (-c) with redirection. Mental model: compression is deterministic, so the same input at a higher level yields a file no larger than at a lower one. The sizes are convenient to compare with stat -c%s.

What's checked

  1. both versions created, original in place
  2. the -9 version is no larger than the -1 version
  3. the files are compressed from data.txt at levels -1 and -9

What it looks like