Jul 29
I’ve often tried to use find, but have never really got over its syntax. It
seems that it’s one of those powerful tools that’s not necessarily obvious to
use at first.
Here’s one way to use it. This:
prints filename which have .sw in them (say, leftover vim swapfiles).
find . -name '*.sw*' -print
You can combine this with grepping. This:
looks for the words ‘tribute to’ in files with the extension .bib.
find . -name "*.bib" -exec echo {}; grep "tribute to" '{}'