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 *

 

 

 

AB 1747-L532 ser D SLC500 processor
$69.0 AB 1747-L532 ser D SLC500 processor picture
Octagon Systems Corp. PS-1000 CPU Power Board GND Signal GND Transformer Artwerk
$285.0 Octagon Systems Corp. PS-1000 CPU Power Board GND Signal GND Transformer Artwerk picture
Waring Commercial 3.5 Qt Batch Bowl Food Processor, Gray - WFP14SGR
$772.17 Waring Commercial 3.5 Qt Batch Bowl Food Processor, Gray - WFP14SGR picture
Hitachi HD63084 Vintage Processor IC PDIP64 x 1pc
$4.99 Hitachi HD63084 Vintage Processor IC PDIP64 x 1pc picture
Ergotron 80 105 064 CPU Mount for CPU 50.00 lb Load Capacity
$31.99 Ergotron 80 105 064 CPU Mount for CPU 50.00 lb Load Capacity picture

Powered by WordPress. Designed by WooThemes