Search code examples
macosfind

GNU find on MacOS


I've downloaded the GNU version of find with homebrew:

brew install findutils --with-default-names

When I run which on find I get what I expect:

$ which find
/usr/local/bin/find

However, when I use find, the system falls back to OS X default /usr/bin/find, i.e.:

$ find -exec file {} \;
find: illegal option -- e
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
       find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]

$ /usr/local/bin/find -exec file {} \;
.: directory

Why is this happening and how can I get find to work properly?


Solution

  • Just start a new terminal. A system restart is an overkill.