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 *

 

 

 

Johnson Controls Actuator M9208-AGC-3
$55.0 Johnson Controls Actuator M9208-AGC-3 picture
Johnson Controls Pneumatic Valve Actuator, 3 - 13 psi, 5/16" Stroke, 30 psi max
$33.0 Johnson Controls Pneumatic Valve Actuator, 3 - 13 psi, 5/16
Johnson Controls VA7810-HGA-2 Valve Actuator
$224.89 Johnson Controls VA7810-HGA-2 Valve Actuator  picture
Johnson Controls Metasys MS-NAE4510-2 SW V 9.0.7
$875.0 Johnson Controls Metasys MS-NAE4510-2 SW V 9.0.7 picture
Johnson Controls VA7820-HGA-2 Valve Actuator
$224.89 Johnson Controls VA7820-HGA-2 Valve Actuator  picture

Powered by WordPress. Designed by WooThemes