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 *

 

 

 

Lot of Vintage Wooden Printers Block Letters Type Letterpress
$14.99 Lot of Vintage Wooden Printers Block Letters Type Letterpress picture
Vintage Antique Mosler BANK VAULT DOORS
$30000.0 Vintage Antique Mosler BANK VAULT DOORS  picture
Lot of TWO 2 Vintage Ace Pilot Staplers #402
$29.99 Lot of TWO 2 Vintage Ace Pilot Staplers #402  picture
Vintage GE Centigrade Thermometer Model TBB5200 General Electric Gauge
$19.99 Vintage GE Centigrade Thermometer Model TBB5200 General Electric Gauge picture
VTG KNU- VISE CLAMP AIRPLANE WELDING USED
$7.5 VTG KNU- VISE CLAMP AIRPLANE WELDING  USED  picture

Powered by WordPress. Designed by WooThemes