Reading compressed Files
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 >.
Trackback URL for this post:
If you like this article, subscribe to our full rss
Please post your question in our forum and use comments only to leave your comments about the article, thanks.













Post new comment