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 *

 

 

 

Sofia + Sam Silver MDF Memory Foam Multi-tasking Lap Desk Silver
$49.99 Sofia + Sam Silver MDF Memory Foam Multi-tasking Lap Desk Silver picture
Hioki 8806 Memory Hicorder
$275.4 Hioki 8806 Memory Hicorder picture
Smith Corona SD700 Spell-Right Dictionary Memory Electronic Typewriter
$64.99 Smith Corona SD700 Spell-Right Dictionary Memory Electronic Typewriter picture
Siemens 545-715 Open Processor Module, Protocol 2 4MB Memory USIP
$50.0 Siemens 545-715 Open Processor Module, Protocol 2 4MB Memory USIP picture
Landis & Gyr 545-701 Controller Module, 4MB Memory USIP
$150.0 Landis & Gyr 545-701 Controller Module, 4MB Memory USIP picture

Powered by WordPress. Designed by WooThemes