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 D-251-405 Damper Actuator
$89.99 Johnson Controls D-251-405 Damper Actuator picture
JOHNSON CONTROLS PCX3711 Explorer FX-PCX3711-0 FX PROGRAMMABLE CONTROLLER Expans
$38.0 JOHNSON CONTROLS PCX3711 Explorer FX-PCX3711-0 FX PROGRAMMABLE CONTROLLER Expans picture
Johnson Controls FX-PCG2621-0 Programmable Controller Used Working Condition
$72.0 Johnson Controls FX-PCG2621-0 Programmable Controller Used Working Condition picture
Johnson Controls CablePro 400. zone bus interface Usb
$50.0 Johnson Controls CablePro 400. zone bus interface Usb picture
Johnson Controls CablePro zone bus interface
$30.0 Johnson Controls CablePro zone bus interface picture

Powered by WordPress. Designed by WooThemes