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 *

 

 

 

NEW Gasboy Site Controller II Memory Board Kit Part# C06759 with Board# C07041
$299.99 NEW Gasboy Site Controller II Memory Board Kit Part# C06759 with Board# C07041 picture
Siemens PLC Memory Card 512KB ; 6ES7-953-8LJ30-0AA0 ; BRAND NEW FACTORY SEALED
$99.99 Siemens PLC Memory Card 512KB ; 6ES7-953-8LJ30-0AA0 ; BRAND NEW FACTORY SEALED picture
DIY Precision DS3231 RTC Real Time Memory Clock Module For Raspberry Pi UE
$5.45 DIY Precision DS3231 RTC Real Time Memory Clock Module For Raspberry Pi UE picture
DIY Precision DS3231 RTC Real Time Memory Clock Module For Raspberry Pi UE
$5.45 DIY Precision DS3231 RTC Real Time Memory Clock Module For Raspberry Pi UE picture
DIY Precision DS3231 RTC Real Time Memory Clock Module For Raspberry Pi UE
$9.45 DIY Precision DS3231 RTC Real Time Memory Clock Module For Raspberry Pi UE picture

Powered by WordPress. Designed by WooThemes