News for hackers. Stuff that matters.
Re:Ask HN: Can I see your cheatsheet? by goodevans on Thursday June 30, 2022 @05:14AM (#31930214)
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)

Re:Ask HN: Can I see your cheatsheet? by pmoriarty on Thursday June 30, 2022 @05:54AM (#31930466)
With 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.