ztest(1)

ztest1

Check the integrity of compressed files

Usage

ztest [options] [files]

Overview

ztest checks the integrity of the compressed files specified. It also warns if an uncompressed file has a compressed file name extension, or if a compressed file has a wrong compressed extension. Uncompressed files are otherwise ignored. If a file is specified as '-', the integrity of compressed data read from standard input is checked. Data read from standard input must be all in the same compressed format. If a file fails to decompress, does not exist, can't be opened, or is a terminal, ztest continues testing the rest of the files. A final diagnostic is shown at verbosity level 1 or higher if any file fails the test when testing multiple files.

If no files are specified, recursive searches examine the current working directory, and nonrecursive searches read standard input.

The formats supported are bzip2, gzip, lzip, xz, and zstd.

Note that error detection in the xz format is broken. First, some xz files lack integrity information. Second, not all xz decompressors can check the integrity of all xz files. Third, section 2.1.1.2 'Stream Flags' of the xz format specification allows xz decompressors to produce garbage output without issuing any warning. Therefore, xz files can't always be checked as reliably as files in the other formats can.

Exit status is 0 if all compressed files check OK, 1 if environmental problems (file not found, invalid command-line options, I/O errors, etc), 2 if any compressed file is corrupt or invalid, or if any file has an incorrect file name extension.

Options

-h, --help

display this help and exit

-V, --version

output version information and exit

-M, --format=<list>

process only the formats in <list>

-N, --no-rcfile

don't read runtime configuration file

-O, --force-format=<fmt>

force the input format

-q, --quiet

suppress all messages

-r, --recursive

operate recursively on directories

-R, --dereference-recursive

recursively follow symbolic links

-v, --verbose

be verbose (a 2nd -v gives more)

--bz2=<command>

set compressor and options for bzip2 format

--gz=<command>

set compressor and options for gzip format

--lz=<command>

set compressor and options for lzip format

--xz=<command>

set compressor and options for xz format

--zst=<command>

set compressor and options for zstd format

Valid formats for options '-M' and '-O' are 'bz2', 'gz', 'lz', 'xz', and 'zst'.

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

--bz2 since Debian 13 (Trixie); --dereference-recursive since Debian 13 (Trixie); --force-format since Debian 13 (Trixie); --format since Debian 13 (Trixie); --gz since Debian 13 (Trixie); --help since Debian 12 (Bookworm); --lz since Debian 13 (Trixie); --no-rcfile since Debian 13 (Trixie); --quiet since Debian 13 (Trixie); --recursive since Debian 13 (Trixie); --verbose since Debian 12 (Bookworm); --version since Debian 13 (Trixie); --xz since Debian 13 (Trixie); --zst since Debian 13 (Trixie); -M since Debian 12 (Bookworm); -N since Debian 13 (Trixie); -O since Debian 13 (Trixie); -R since Debian 13 (Trixie); -V since Debian 12 (Bookworm); -h since Debian 12 (Bookworm); -q since Debian 13 (Trixie); -r since Debian 13 (Trixie); -v since Debian 13 (Trixie).

--dump-debug until Debian 12 (Bookworm); --multi-host until Debian 12 (Bookworm); --option until Debian 12 (Bookworm); --use-existing-pool until Debian 12 (Bookworm); -? until Debian 12 (Bookworm); -E until Debian 12 (Bookworm); -G until Debian 12 (Bookworm); -o until Debian 12 (Bookworm).

Reporting bugs

Report bugs to [email protected]
Zutils home page: http://www.nongnu.org/zutils/zutils.html

From zutils 1.14-5 in Debian 13 (Trixie). Also shipped by zfs-test. Parsed by carta from the page's man source.