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 *

 

 

 

ARC GEAR AG25C-35 Steel Grip 25-Cal Elect Arc Flash Jacket Dark Blue Mens Large
$29.99 ARC GEAR AG25C-35 Steel Grip 25-Cal Elect Arc Flash Jacket Dark Blue Mens Large picture
Flash Furniture 96inL x 36inW Melamine Folding Table- Mahogany
$154.99 Flash Furniture 96inL x 36inW Melamine Folding Table- Mahogany picture
DuPont Tyvek Flashing Tape - 6" x 75' - 1 Roll
$60.48 DuPont Tyvek Flashing Tape - 6
Salisbury 8 cal/cm2 Pro-Wear Arc Flash Protection Premium Coveralls - Size XL
$140.0 Salisbury 8 cal/cm2 Pro-Wear Arc Flash Protection Premium Coveralls - Size XL picture
Voice Recorder Audio Dictaphone MP3 Player USB Flash Disk for Meeting N2B2
$18.78 Voice Recorder Audio Dictaphone MP3 Player USB Flash Disk for Meeting N2B2 picture

Powered by WordPress. Designed by WooThemes