|
Search first line of compressed file
I want to read a directory full of compressed files and move the file to another directory if it meets certain criteria. I only want to look at the first line of the compressed file and if I find the string, do the move. I am currently using the following:
zgrep -R -L IH120070731/psoft/bnydata/etl/BNY_CRDW_UAT/source_archive/08012007 | xargs -i {} mv {} ../20070731/{}
This does fine and doesn't run too bad if most of the files will be moved. It takes forever for the zgrep to go through every line of every file when I really only want to check the first line.
Any ideas on how to limit the search to the first line only?
Thanks in advance.
|