LinuxCommandLibrary

znew

Convert compress (.Z) files to gzip format

TLDR

Convert .Z file to .gz

$ znew [file.Z]
copy
Convert multiple files
$ znew [*.Z]
copy
Keep original file
$ znew -K [file.Z]
copy
Use best compression
$ znew -9 [file.Z]
copy
Force conversion even if .gz exists
$ znew -f [file.Z]
copy

SYNOPSIS

znew [-ftv9PK] file.Z...

DESCRIPTION

znew recompresses files from the old compress format (.Z) to gzip format (.gz). The compress utility used LZW compression, while gzip uses DEFLATE which typically achieves better compression ratios.
The tool is useful for converting legacy compressed archives to the more modern and efficient gzip format. After conversion, the original .Z file is deleted by default.
znew verifies the integrity of the new .gz file before removing the original when using the -t flag, providing safety against corruption.

PARAMETERS

-f

Force recompression even if .gz file already exists
-t
Test new file integrity before deleting original
-v
Verbose output
-9
Use best compression level
-P
Use pipes for conversion (slower but uses less disk space)
-K
Keep the original .Z file

CAVEATS

Only converts .Z files to .gz. Does not handle other compression formats.
Without -K, the original file is deleted after successful conversion.
The -P option uses more CPU but less temporary disk space.
Modern systems rarely encounter .Z files, making this tool primarily useful for archival work.

HISTORY

The compress utility and .Z format date from the 1980s. gzip was created in 1992 as a free alternative that avoided LZW patent issues. znew was created to facilitate migration from the older format.

SEE ALSO

gzip(1), gunzip(1), zcat(1), compress(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community