Zutils

[ English | Espaņol ]

Introduction

Zutils is a collection of utilities able to process any combination of compressed and uncompressed files transparently. If any file given, including standard input, is compressed, its decompressed content is used. Compressed files are decompressed on the fly; no temporary files are created. Data format is detected by its identifier string (magic bytes), not by the file name extension.

These utilities are not wrapper scripts but safer and more efficient C++ programs. In particular the option '--recursive' is very efficient in those utilities supporting it.

The utilities provided are:
zcat - Decompresses and copies files to standard output.
zcmp - Decompresses and compares two files byte by byte.
zdiff - Decompresses and compares two files line by line.
zgrep - Decompresses and searches files for a regular expression.
ztest - Tests integrity of compressed files.
zupdate - Recompresses files to lzip format.

The formats supported are bzip2, gzip, lzip, xz, and zstd.
Zutils uses external compressors. The compressor to be used for each format is configurable at runtime.

zcat, zcmp, zdiff, and zgrep are improved replacements for the shell scripts provided by GNU gzip. ztest is unique to zutils. zupdate is similar to gzip's znew.

NOTE: Bzip2 and lzip provide well-defined values of exit status, which makes them safe to use with zutils. Gzip and xz may return ambiguous warning values, making them less reliable back ends for zutils. Zstd currently does not even document its exit status in its man page.

FORMAT NOTE 1: The option '--format' allows the processing of a subset of formats in recursive mode and when trying compressed file names. For example, use the following command to search for the string 'foo' in gzip and lzip files only: "zgrep foo -r --format=gz,lz somedir somefile.tar".

FORMAT NOTE 2: The standard POSIX compress format (.Z) is obsolete and is only supported through gzip. For this to work, the gzip program used (for example GNU gzip) must be able to decompress .Z files.

LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never have been compressed. Decompressed is used to refer to data which have undergone the process of decompression.

Documentation

The manual is available in the info system of the GNU Operating System. Use info to access the top level info page. Use info zutils to access the zutils section directly.

An online manual for zutils can be found at manual/zutils_manual.html.

Download

The latest released version of zutils can be found at http://download.savannah.gnu.org/releases/zutils/. You may also subscribe to zutils-bug and receive an email every time a new version is released.

To decompress zutils tarballs you may need lzip from http://www.nongnu.org/lzip/lzip.html. Then use "tar -xf zutils[version].tar.lz" or "lzip -cd zutils[version].tar.lz | tar -xf -" to extract the files.

How to Get Help

For general discussion of bugs in zutils the mailing list zutils-bug@nongnu.org is the most appropriate forum. Please send messages as plain text. Please do not send messages encoded as HTML nor encoded as base64 MIME nor included as multiple formats. Please include a descriptive subject line. If all of the subject are "bug in zutils" it is impossible to differentiate them.

An archive of the bug report mailing list is available at http://lists.gnu.org/mailman/listinfo/zutils-bug.

How to Help

To contact the author, either to report a bug or to contribute fixes or improvements, send mail to zutils-bug@nongnu.org. Please send messages as plain text. If posting patches they should be in unified diff format against the latest version. They should include a text description.

See also the zutils project page at Savannah.

Licensing

Zutils is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

Valid HTML 4.01 Strict


Copyright © 2023 Antonio Diaz Diaz

You are free to copy, modify, and distribute all or part of this article without limitation.

Updated: 2023-01-08

This page does not use javascript.