Man page



sxgzip, sxgunzip, sxzcat — multithreaded compression/decompression tools


sxgzip -b blocksize -cdfhik -l level -n -p threads -r -S suffix -tvV file …

sxgunzip -cfhiknN -p threads -r -S suffix -tvV file …

sxzcat -hn -p threads -vV file …


sxgzip compresses using threads to make use of multiple processors and cores. The input is broken up into chunks with each compressed in parallel using the deflate compression method. The compression produces independent raw deflate streams which are wrapped with the appropriate gzip header and trailer and are written in order to the output. This adds an overhead to the output for each input chunk, but allows parallel decompression. The overhead comprises of a gzip header (10), trailer (8), SX header extension (24) bytes to be added to each input block, and zlib format wrapping and deflate overhead resulting form input stream division to separate chunks.

The default input block size is 1000000 bytes, but can be changed with the -b option. The number of compress threads is set by default to max(2, available_cores / 2), which can be changed using the -p option.

Compressed files can be restored to their original form using sxgzip -d or sxgunzip. As the files are fully compatible with gzip format, they can also be processed with original gzip utility

In other aspects, the programs behave like original gzip utilities. If no files are specified, sxgzip will compress from standard input, or decompress to standard output. When in compression mode, each file will be replaced with another file with the suffix, set by the -S suffix option, added, if possible.

In decompression mode, each file will be checked for existence, as will the file with the suffix added. Each file argument must contain one separate complete sxgz archive; when multiple files are indicated, each is decompressed in turn.

In the case of sxzcat the resulting data is then concatenated in the manner of cat.

If invoked as sxgunzip then the -d option is enabled. If invoked as sxzcat then the -c, -d and -k options are enabled.


-b,--blocksize <num>

length of plain text block in bytes, default is 1000000


write on standard output, keep original files unchanged


decompress files


force overwrite of output file


give this help


print chunk info, -p ignored


keep (don’t delete) input files

-l,--level <num>

compression level: 1 fastest (worst) compression .. 9 best (slowest) compression


when compressing, no filename and timestamp from being stored in the output file; when decompressing, no crc checks


when decompressing, use filename stored in the input file (if any) as the output file name

-p,--num-threads <num>

number of threads to use, default is max(2, cores/2)


recursively process files in directories

-S,--suffix <SUF>

use suffix .SUF instead of .sx.gz on compressed files


test compressed file and print chunk info, -p ignored


verbose mode, print extra info to standard error


display program version