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 *

 

 

 

MKS 131882-G7 Baratron Pressure Transducer (Lot of 3)
$49.99 MKS 131882-G7 Baratron Pressure Transducer (Lot of 3) picture
Flexcore Division Transducer CT5-005E2 4-20mA = 0-5A
$100.0 Flexcore Division  Transducer CT5-005E2  4-20mA =  0-5A picture
Ohio Semitronics DC Voltage Transducer VT7-001DY139 ( 2 used)
$29.99 Ohio Semitronics DC Voltage Transducer VT7-001DY139  ( 2 used) picture
T161108 MKS 722A12TCE2FA Baratron Pressure Transducer 100 Torr
$150.0 T161108 MKS 722A12TCE2FA Baratron Pressure Transducer 100 Torr picture
Ohio Semitronics VT7-002E-22 DC Voltage Transducer 0-25vdc In, 4-20mAdc Out
$29.99  Ohio Semitronics VT7-002E-22 DC Voltage Transducer 0-25vdc In, 4-20mAdc Out  picture

Powered by WordPress. Designed by WooThemes