Linux.com

...misses the point a little..

Posted by: Anonymous Coward on November 01, 2005 12:25 AM
I've probably done the same thing, but it sort of defeats the purpose of using 'find' in the first place. If you're going to do your pattern matching with grep, you're probably just as well off using "ls -aR |grep (whatever)".. it's somewhat faster.

On the other hand, find (once you learn its capabilities) has alot more to offer. Even the basic '-iname *.mp3' is handy; you can combine boolean comparisons together in a single command-line (think -iname *.mp3 -or -iname *.ogg). find can also perform actions on its results rather than just listing them (think 'find -iname *.swp -or -iname *~ -delete', for example), which really helps for scriptability. (Check out the man page to really get a feel for the capabilities; if you're looking for a single command to delete all files under a directory matching a regex and older than a certain age.. find is absolutely for you.

#

Return to CLI Magic: GNU find