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 *

 

 

 

Steris S40 Sterilant Concentrate for use in SYSTEM 1E® Processor
$110.0 Steris S40 Sterilant Concentrate for use in SYSTEM 1E® Processor  picture
Gamewell SAN-CPU
$150.0 Gamewell SAN-CPU picture
Mitsubishi A172SHCPUNF-B A172 CPU Motion Controller 8 AXIS T118040
$499.0 Mitsubishi A172SHCPUNF-B A172 CPU Motion Controller 8 AXIS T118040 picture
GE Fanuc IC692CPU211D Programmable Controller T116647
$110.77 GE Fanuc IC692CPU211D Programmable Controller T116647 picture

Powered by WordPress. Designed by WooThemes