You can easily display compressed files on Linux or Unix without using using the cat command, less, or more command. In this example, show the contents of a text file called resume.txt.gz that has been compressed using gzip and friends. Open the Terminal and then type the following commands.
Display resume.txt.gz on screen using cat command like syntax:
Display access_log_1.gz on screen at a time:
Or try zless (less command):
Search access_log_1.gz for 126.96.36.199 IP address using grep command like syntax:
zgrep '188.8.131.52' access_log_1.gz
You can use egrep command like syntax:
egrep 'regex' access_log_1.gz egrep 'regex1|regex2' access_log_1.gz