znew Command Examples in Linux

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 [-ftv9K] file

znew command examples

1. To compress .Z file to .gz:

# znew test.Z

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

# znew -f test.Z

3. To test the new files before deleting originals:

# znew -t test.Z

4. To use the slower compression method:

# znew -9 test.Z

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

# znew -K test.Z

6. To use less disk space while converting:

# znew -p test.Z
Related Post