3 ms·
find . | grep 'abc' === find . -name 'abc' find . | grep -i 'abc' === find . -iname 'abc' Here, saved you a pipe :) (Oh, and with -exec and -delete, not needi
by marcosdumay 11y ago
find . | grep 'abc' === find . -name 'abc'
find . | grep -i 'abc' === find . -iname 'abc'
Here, saved you a pipe :)
(Oh, and with -exec and -delete, not needing that pipe is incredibly useful. Find is an incredibly powerful command.)
- Sodel 11y agoSorry if this is pedantic, but actually: find . | grep 'abc' === find . -name '*abc*' find . | grep -i 'abc' === find . -iname '*abc*' The -name and -iname options do a verbatim file name check if you don't include those wild-card asterisks. I've been inconvenienced by having to go back and add them often enough that this is burned into my brain. :-)