≡ Menu

zcat command

Unix / Linux: cat .GZ Compressed Text File On Screen

To save the disk space on my Linux based nas (network storage server), I have compressed thousands of reports[0-1000].txt files using gunzip program. However, I need to cat .gz file (or open in vim text editor) for reference purposes. I have a log files stores on my nas server in compressed format using gzip command. How do I display compressed Apache log file without using cat command? How to display the contents of gzip text files in screen without unzipping?
[click to continue…]

Grep Compressed .gz Files At A Shell Prompt

I am a new Unix/Linux shell user and I have lots of .gz files in my directory. I would like to search .gz files using the grep command. Unfortunately, grep command is not working on my compressed files. How do I write a script to automate entire procedure to grep some compressed files? Do I have to uncompress them first and run grep over them?
[click to continue…]