How to view a compressed log file in gnuzip format

Log files are generally compressed, to save disk space. But it can be quite a hassle if we are to uncompressed one by one to just browse through them. There is a utility / command that will make our life easier :
gzcat <tar.gz or .gz compressed file>
gzcat text.tar.gz

If the log file is more then a screen full, use less to pause every screen full.
gzcat text.tar.gz | less

Alternatively, use "zless". It would also pause every screen full
zless <tar.gz or .gz compressed file>
zless text.tar.gz

Hasta la vista !!!

No comments: