Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

Reading compressed Files

Date: 2008-03-13 00:00:00 -0400

I did not know this, but if you need to show a compressed text file on the screen, you do not actually need to uncompress it.

You can use zcat to send the file to the standard output, uncompressed, but the original file remains untouched.

The syntax of the command is:

zcat file.gz

or you can also use,

gunzip -c file.gz

what is going to happen is that the file will be uncompressed on the fly, sent to the standard output (usually screen).

If the .gz file contains more than one file they will be shown in sequence, you can also redirect the output using >.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.