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 *

 

 

 

IC600LR605K General Electric 4K Logic/ 1K Resistor Memory Series Six --SA
$425.2 IC600LR605K General Electric 4K Logic/ 1K Resistor Memory Series Six  --SA picture
IC600LX624L General Electric 16K Logic/ 8K Memory Module Series Six --SA
$1750.2 IC600LX624L General Electric 16K Logic/ 8K Memory Module Series Six  --SA picture
Okuma E0227-702-009 Bubble Memory Card
$750.0 Okuma E0227-702-009 Bubble Memory Card picture
Allen Bradley, SLC 500, 1747-M2, SER A, 4K EEPROM Memory, Great Shape
$43.95 Allen Bradley, SLC 500, 1747-M2, SER A, 4K EEPROM Memory, Great Shape picture
Allen Bradley, MicroLogix 1100, 1763-L16BWA, SER B, with Memory, Nice Shape
$319.95 Allen Bradley, MicroLogix 1100, 1763-L16BWA, SER B, with Memory, Nice Shape picture

Powered by WordPress. Designed by WooThemes