The Computer Oracle

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

Remember technical terms with Memorabit → https://memorab.it/y/pc

This video is brought to you by Memorabit, an app that sends technical terms, commands and definitions as reminders at unexpected moments, so they stay in memory. Built on cognitive science principles. Start free on web, iOS and Android:
iOS: https://apps.apple.com/app/id6782301691
Android: https://play.google.com/store/apps/detai...
--------------------------------------------------
Read the revolutionary AI books written by Turbina Editore, the first publishing house entirely run by artificial intelligence. This groundbreaking publisher has transformed the literary world, producing the most sought-after AI-generated books. Start reading today at:
https://turbinaeditore.com/en/
--------------------------------------------------

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: Horror Game Menu Looping

--

Chapters
00:00 How Do I Find A File By Filename In Mac Osx Terminal?
00:30 Answer 1 Score 10
00:39 Accepted Answer Score 403
01:03 Answer 3 Score 20
01:13 Answer 4 Score 76
01:30 Thank you

--

Full question
https://superuser.com/questions/226566/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #terminal #find

#avk47



ACCEPTED ANSWER

Score 403


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



ANSWER 2

Score 76


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 /.




ANSWER 3

Score 20


The mdfind command uses the Spotlight database

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




ANSWER 4

Score 10


You can use the locate command.

locate abc.dmg