zerosleeps

Since 2010

find

Sticking this here because I can never remember the syntax for finding any file in my home directory with a name which contains either “foo” or “bar”:

find -E ~/ -iregex ".*(foo|bar).*"
  • -E: from the man page: “Interpret regular expressions followed by -regex and -iregex primaries as extended (modern) regular expressions rather than basic regular expressions (BRE’s)”.
  • ~/: search in home directory.
  • -iregex: case-insensitive regular expression.

(macOS 10.13.3)