Hacker News new | ask | show | jobs
by marcosdumay 3910 days 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.)

1 comments

Sorry 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. :-)