Find files which contains both the words using grep located in any directory.

Deepika Gunda
1 min readMar 17, 2020

grep -irlZ ‘ProductsGrid’ * — exclude-dir={node_modules,dist} | xargs -0 grep -l “product_ids”

The i is for case-insensitive search.

Excluding certain folders using exclude-dir.

This command searches for files which contain both the words ‘ProductsGrid’ and ‘product_ids’ .

--

--

Deepika Gunda

I am a Software Engineer n Tech Enthusiast . You will see me publishing articles on Javascript, NodeJS and misc.