Linux Recursive GREP search excluding directories example

This command will search for text inside files in a directory while excluding some directories you do not want to search in.

This is helpful when a search is going slow due to a directory that might contain thousands of files that you are not interested in searching through, such as an images or cache directory.

grep -r –exclude-dir=product_images –exclude-dir=cache –exclude-dir=.svn search term *

 

 

 

Vtg Hoke Pratt & Whitney Precision Gage Blocks set 28 pcs .010-.090 w/wood box
$89.0 Vtg Hoke Pratt & Whitney Precision Gage Blocks set 28 pcs .010-.090 w/wood box picture
Vintage Federal Testmaster M-1 Dial Test Indicator .001" Jeweled, USA
$32.95   Vintage Federal Testmaster M-1 Dial Test Indicator .001
Vtg Norton Abrasives Hard Arkansas Oilstone Whetstone Machinist Tool Knife Maker
$44.99 Vtg Norton Abrasives Hard Arkansas Oilstone Whetstone Machinist Tool Knife Maker picture
VINTAGE TOOLMAKER MADE ADJUSTABLE MILLING MACHINE VICE STOP USA
$47.95  VINTAGE TOOLMAKER MADE ADJUSTABLE MILLING MACHINE VICE STOP USA  picture
VINTAGE TOOLMAKER MADE STEPPED PARALLELS 2 SETS USA
$47.95  VINTAGE TOOLMAKER MADE STEPPED PARALLELS 2 SETS USA  picture

Powered by WordPress. Designed by WooThemes