3 ms·
Find all .txt files containing the word 'foo': find ./ -mount -type f -name "*.txt" -exec grep -iHn 'foo' {} \; (the -mount stops it traversing into mounted sh
by goodevans 4y ago
Find all .txt files containing the word 'foo':
find ./ -mount -type f -name "*.txt" -exec grep -iHn 'foo' {} \;
(the -mount stops it traversing into mounted shares)
- pmoriarty 4y agoWith zsh: grep -iHn 'foo' **/*.txt(.) Though I'm not sure how to prevent zsh from descending in to other filesystems, as you can with find.