How do I find a file by filename in Mac OSX terminal?

In its simplest form, find takes one parameter: the path. In its actually useful form, it takes the path followed by narrowing criteria.

Thus, you want:

  • find (the program)
  • / (the path), and
  • -name abc.dmg (the criteria).
find / -name abc.dmg

find . -name '*.csv' for instance worked for me with wildcards. OP could also use find . -name '*.dmg' to check his current directory, assuming he was in /.


The mdfind command uses the Spotlight database

http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/mdfind.1.html