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 *

 

 

 

Vintage Micronics 08-00156-08 Circuit Board 9247 256K Rev B MEMORY RAM
$25.99 Vintage Micronics  08-00156-08 Circuit Board 9247 256K Rev B MEMORY RAM picture
VIKING COMPONENTS Hyundai 9637416 HY5118160B 9651A KOREA RAM MEMORY STICK
$17.99 VIKING COMPONENTS Hyundai 9637416 HY5118160B 9651A KOREA RAM MEMORY STICK picture
SIEMENS SIMATIC S5 6ES5375-1LA21 MEMORY SUBMODULE *NEW NO BOX*
$145.0 SIEMENS SIMATIC S5 6ES5375-1LA21 MEMORY SUBMODULE *NEW NO BOX* picture
FISHER SCIENTIFIC Traceable Thermometer with Time/Date Max/Min Memory 15-077-723
$46.95 FISHER SCIENTIFIC Traceable Thermometer with Time/Date Max/Min Memory 15-077-723 picture

Powered by WordPress. Designed by WooThemes