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 *

 

 

 

BCR8PM-8L TRANSISTOR TO-220F Semiconductor BCR8PM New UK Stock
$7.32 BCR8PM-8L TRANSISTOR TO-220F Semiconductor BCR8PM New UK Stock picture
5 x 6R380C6 N-Channel MOSFET Transistor IPD60R380C6 TO-252
$9.5 5 x 6R380C6 N-Channel MOSFET Transistor IPD60R380C6 TO-252 picture
10 x BUK7614-55 MOS transistor FET BUK7614-55A TO-263
$3.72 10 x BUK7614-55 MOS transistor FET BUK7614-55A TO-263 picture
10 x CR3AS CR3AS-12 3A 600V Transistor CR3AS-12C-T13 TO-252
$6.5 10 x CR3AS CR3AS-12 3A 600V Transistor CR3AS-12C-T13 TO-252 picture
CenTech 7 Function Digital Multimeter AC DC Vol/Resistance/Transistor/Diode
$7.95 CenTech 7 Function Digital Multimeter AC DC Vol/Resistance/Transistor/Diode picture

Powered by WordPress. Designed by WooThemes