The znew utility uncompresses files compressed by compress and recompresses them with gzip. These files normally have an extension of “.Z”. These files are then re-compressed with an extension of “.gz”. The znew utility tries to maintain the file mode of the original file. If the original file is not writable, it is not able to do that and znew will print a warning.

Syntax of the command:

znew command examples

1. To compress .Z file to .gz:

2. To force compress from .Z to .gz enven if .gz file exists:

3. To test the new files before deleting originals:

4. To use the slower compression method:

5. To keep the original file if its smaller than .gz file:

6. To use less disk space while converting: