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 *

 

 

 

SETEX CPU - BGL03000 Module -
$250.0 SETEX CPU - BGL03000 Module -  picture
Fans & Cooling 1 Pack - 4 Grams Thermal Compound Paste, Carbon Based High CPU PC
$8.62 Fans & Cooling 1 Pack - 4 Grams Thermal Compound Paste, Carbon Based High CPU PC picture
BOGEN COMMUNICATIONS PCM2000-B TIM, CPU, ZPM 3-ZONE PAGING SYSTEM -FREE SHIPPING
$37.99 BOGEN COMMUNICATIONS PCM2000-B TIM, CPU, ZPM 3-ZONE PAGING SYSTEM -FREE SHIPPING picture
Asus ZenPad Z8 - 8" 2K Display - 1.8GHz 6-Core Processor - Android M (ZT581KL)
$295.99 Asus ZenPad Z8 - 8
NEW Square D 8020 SCP-523 SY/MAX Model 500 Processor
$499.99 NEW Square D 8020 SCP-523 SY/MAX Model 500 Processor picture

Powered by WordPress. Designed by WooThemes