Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
goodevans
on June 30, 2022
|
parent
|
context
|
favorite
| on:
Ask HN: Can I see your cheatsheet?
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
on June 30, 2022
[–]
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
(the -mount stops it traversing into mounted shares)