znew: command to recompress .za .gz files

Zipped folder icon

Not long ago I published on this blog a tutorial on the file compression / decompression in Linux. And to complement, we are going to include this new post about the znew command, a command that may not be too well known but that allows us to recompress the files that we have compressed with the .za .gz extension in a simple and fast way, without the need to decompress them and compress them again in the new format, saving us a valuable step and time that we can dedicate to something more productive ...

The znew command is already included in most distributions best known, so you won't have to install it. I have tested it on several distros and all of them came pre-installed. However, if you find that it is not installed on your distro, especially those like Arch and others that don't include pre-installed packages, you can easily install it using your distro's package manager. So in the worst case, you will have to execute a command to install it.

La way to use it The general rule is executing the command followed by the options and the name of the file that we want to recompress, that is:

znew [-opciones] [nombre_fichero.z]

You can see all the options and information using the manual:

man znew

Good, and the way of use is very simple. If you have a .zy file you want it convert to .gz, you will not have to first unzip the .z and then compress the unzipped file or files in .gz format with another tool, but you can directly go from one to another with a single command:

znew mi_archivo.z

This will generate an output my_file.gz. If there is already a .gz file with the same name in the same directory where you are working, confirmation will be asked to replace it. However, you can use the -f option to do it yes or yes, without asking, but you should know that the old .gz will be replaced. And you know, if you want details to be displayed, you can use the -v option. For example:

znew -vf mi_archivo.z

You should know that they exist more functions, but perhaps these are the most common ... I hope it has helped you.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.