Files
znew
Recompress .Z files to .gz format.
compressgziprecompressconvert.Z
Additional Notes
znew recompresses files from the old Unix compress format (.Z) to the gzip format (.gz). It decompresses the .Z file and recompresses it with gzip, which typically achieves better compression ratios. The original .Z file can be optionally removed after conversion.
This tool was useful during the transition from compress to gzip. It is rarely needed today since .Z files are uncommon. The conversion preserves the file's timestamp and mode.
Syntax
znew [options] file[.Z]...
Parameters
file: One or more.Zfiles to convert.
Common Options
-f,--force: Force conversion even if a.gzfile already exists.-t,--test: Test the integrity of the new.gzfile before removing the original.-v,--verbose: Show compression ratios and progress.-9: Use maximum compression level.-K,--keep: Keep the original.Zfile (do not remove after conversion).-P,--small: Use the smallest possible memory level (slower but less memory).
Examples
znew file.Z
Convert file.Z to file.gz and remove file.Z.
znew -K file.Z
Convert file.Z to file.gz but keep the original.
znew -v -9 file.Z
Convert with maximum compression and show verbose output.
znew -t *.Z
Convert all .Z files and test each new .gz before removing originals.
Practical Notes
- If the resulting
.gzfile is not smaller, the conversion is skipped (unless-fis used). - The
-tflag is recommended to ensure data integrity before the original is removed. - Modern systems usually have
gunzipwhich can decompress both.Zand.gzdirectly, making explicit conversion unnecessary. - Use
zcatto read either format without conversion.