SQ(1)

๐Ÿ“ฆ version 3.4.06, in nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

๐Ÿ’– SQ(1) ๐Ÿ’–

okay so this is the General Commands Manual entry for sq and unsq, and it's giving โ€œtiny compression tool with main character energyโ€ โœจ stay with me bestie, it's literally so simple.


๐ŸŒธ NAME ๐ŸŒธ

sq, unsq โ€” squeeze or unsqueeze a sorted word list. That's the whole name section, periodt ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

sq < infile > outfile

unsq < infile > outfile

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

sq compresses a sorted list of words (a dictionary). For example:

sort -u /usr/dict/words | sq | gzip -9 > words.sq.Z

will compress dict by about a factor of 5. slay ๐Ÿ’–

unsq uncompress the output of sq. For example:

gunzip < words.sq.gz | unsq | sort -f -o words

will uncompress a dictionary compressed with sq. iconic behavior honestly ๐Ÿซถ

The squeezing is achieved by eliminating common prefixes, and replacing them with a single character which encodes the number of characters shared with the preceding word. The prefix size is encoded as a single printable character, like this:

  • 0โ€“9 represent 0โ€“9
  • Aโ€“Z represent 10โ€“35
  • aโ€“z represent 36โ€“61

no cap, that's the whole encoding vibe ๐ŸŒˆ


๐Ÿ’€ BUGS ๐Ÿ’€

sq and unsq can only handle words of up to 256 characters. The input must be sorted, and duplicates must be suppressed.

bestie please read that twice ๐Ÿ˜ญ if your list is unsorted or full of dupes, this is not the moment. and 256 characters is the limit, fr fr.

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Mike Wexler


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

compress(1), sort(1).


cute little sign-off: the footer says source/version LOCAL and page tag SQ(1) โ€” and there's no date on it, bestie โ€” so that's the tea ๐Ÿ“โœจ

๐Ÿ“ฆ where this page comes from