Find Command with Regular Expressions

Find Command with Regular Expressions

I am practicing a find command and the moment, and am curious about the usage of regular expressions in the find command(similar to grep). Does the command support it? If so, what are the options to enable it?

I tried looking for it in the man pages but was unsuccessful so far.

1

1 Answer

From man find:

-regex pattern
              File  name  matches regular expression pattern.  This is a match
              on the whole path, not a search.  For example, to match  a  file
              named `./fubar3', you can use the regular expression `.*bar.' or
              `.*b.*3', but not `f.*r3'.  The regular  expressions  understood
              by  find  are by default Emacs Regular Expressions, but this can
              be changed with the -regextype option.
6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.