Thursday, August 18, 2011

Use wildcard in the command find

To use a wildcard * in the find command needs a little more care.

Without quote or backslash \, such as
find . foo*bar -print
the shell will expand * before passing it into find command.  This results is a different, and most likely a narrower, search.

To avoid that, use
find . 'foo*bar' -print
find . foo\*bar -print

No comments:

Post a Comment