This manual is for Zutils (version 1.0-rc1, 18 January 2012).
Copyright © 2008, 2009, 2010, 2011, 2012 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission to copy, distribute and modify it.
Zutils is a collection of utilities able to deal with any combination of compressed and non-compressed files transparently. If any given file, including standard input, is compressed, its uncompressed content is used. Compressed files are decompressed on the fly; no temporary files are created. These utilities are not wrapper scripts but safer and more efficient C++ programs. In particular the `--recursive' option is very efficient in those utilities supporting it.
The provided utilities are zcat, zcmp, zdiff, zgrep and ztest.
The supported compressors are bzip2, gzip, lzip and xz.
Numbers given as arguments to options (positions, sizes) may be followed by a multiplier and an optional `B' for "byte".
Table of SI and binary prefixes (unit multipliers):
| Prefix | Value | | | Prefix | Value
|
| k | kilobyte (10^3 = 1000) | | | Ki | kibibyte (2^10 = 1024)
|
| M | megabyte (10^6) | | | Mi | mebibyte (2^20)
|
| G | gigabyte (10^9) | | | Gi | gibibyte (2^30)
|
| T | terabyte (10^12) | | | Ti | tebibyte (2^40)
|
| P | petabyte (10^15) | | | Pi | pebibyte (2^50)
|
| E | exabyte (10^18) | | | Ei | exbibyte (2^60)
|
| Z | zettabyte (10^21) | | | Zi | zebibyte (2^70)
|
| Y | yottabyte (10^24) | | | Yi | yobibyte (2^80)
|
Zcat copies each given file (`-' means standard input), to standard output. If any given file is compressed, its uncompressed content is used. If a given file does not exist, and its name does not end with one of the known extensions, zcat tries the compressed file names corresponding to the supported compressors. If no files are specified, data is read from standard input, decompressed if needed, and sent to standard output. Data read from standard input must be of the same type; all uncompressed or all compressed with the same compressor.
The format for running zcat is:
zcat [options] [files]
Exit status is 0 if no errors occurred, 1 otherwise.
Zcat supports the following options:
Zcmp compares two files (`-' means standard input), and if they differ, tells the first byte and line number where they differ. Bytes and lines are numbered starting with 1. If any given file is compressed, its uncompressed content is used. Compressed files are decompressed on the fly; no temporary files are created.
The format for running zcmp is:
zcmp [options] file1 [file2]
Compares file1 to file2. If file2 is omitted zcmp
tries the following:
If file1 is compressed, compares file1 to the file with the
corresponding decompressed file name (removes the extension from
file1).
If file1 is not compressed, compares file1 to the
uncompressed contents of file1.[bz2|gz|lz|xz] (the first one that
is found).
If no suitable file is found, compares file1 to data read from
standard input.
An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble.
Zcmp supports the following options:
Zdiff compares two files (`-' means standard input), and if they differ, shows the differences line by line. If any given file is compressed, its uncompressed content is used. Zdiff is a front end to the diff program and has the limitation that messages from diff refer to temporary filenames instead of those specified.
The format for running zdiff is:
zdiff [options] file1 [file2]
Compares file1 to file2. If file2 is omitted zdiff
tries the following:
If file1 is compressed, compares file1 to the file with the
corresponding decompressed file name (removes the extension from
file1).
If file1 is not compressed, compares file1 to the
uncompressed contents of file1.[bz2|gz|lz|xz] (the first one that
is found).
If no suitable file is found, compares file1 to data read from
standard input.
An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble.
Zdiff supports the following options:
Zgrep is a front end to the grep program that allows transparent search on any combination of compressed and non-compressed files. If any given file is compressed, its uncompressed content is used. If a given file does not exist, and its name does not end with one of the known extensions, zgrep tries the compressed file names corresponding to the supported compressors. If no files are specified, data is read from standard input, decompressed if needed, and fed to grep. Data read from standard input must be of the same type; all uncompressed or all compressed with the same compressor.
The format for running zgrep is:
zgrep [options] pattern [files]
An exit status of 0 means at least one match was found, 1 means no matches were found, and 2 means trouble.
Zgrep supports the following options:
Ztest verifies the integrity of the specified compressed files. Non-compressed files are ignored. If no files are specified, the integrity of compressed data read from standard input is verified. Data read from standard input must be all compressed with the same compressor.
The format for running ztest is:
ztest [options] [files]
The exit status is 0 if all files verify OK, 1 for environmental problems (file not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or invalid input file.
Ztest supports the following options:
There are probably bugs in zutils. There are certainly errors and omissions in this manual. If you report them, they will get fixed. If you don't, no one will ever know about them and they will remain unfixed for all eternity, if not longer.
If you find a bug in zutils, please send electronic mail to zutils-bug@nongnu.org. Include the version number, which you can find by running `zutils --version'.