How do I grep for a string recursively through all .gz files in all directories and subdirectories?
|
feedback
|
migrated from stackoverflow.com May 25 '10 at 4:18
This question came from our site for professional and enthusiast programmers.
|
@Steve Weet is almost there. The use of /dev/null as an additional argument is a nice way to force the filename to be shown (I'll remember that, thanks Steve) but it still runs the exec for every file found -- a huge overhead. You want to run zgrep as few times as you can, getting the most out of each execution:
| |||||||||
feedback
|
So something like
| |||||||||
feedback
|
|
@aioobe is almost there. The command will do the job but won't tell you the file name The following should tell you the filename as well:
The addition of EDIT Further research reveals that for my machine (OS/X) the | |||||||
feedback
|
|
The following works a treat in
It may also work in | |||
|
feedback
|
