25

I'm on Mac OS X 10.5 (Leopard). What's the best way to find a folder for which I'm not sure of the full name?

For example, I know the folder name I want is like:

  • "farm-animal-type"

But the full name may be something like:

  • "farm-animal-type-horse"

On Windows, I would just use the find tool through Windows Explorer.

migrated from stackoverflow.com Feb 20 '10 at 2:33

This question came from our site for professional and enthusiast programmers.

47

If you take interest in the command line:

find / -type d -name "*farm-animal-type*"

you can change the starting area from / to whatever you want if you have a good idea of where the folder is generally located. Spotlight will be much snappier as the folders are indexed though.

  • 3
    Should one take interest in both the command line and the snappyness of spotlight, one might find mdfind [whatever] interesting ;-) – trolle3000 Feb 26 '10 at 0:56
  • 1
    I prefer to use -iname to ignore the case of the folder. – Mark Thalman Mar 17 '10 at 17:40
10

Spotlight

In the top right of any finder window there is a text-based input for searching.

OR, the magnifying glass in the menubar on the top right of the screen.

  • Or Command-Space if your Spotlight settings are still the default. – dotHTM Mar 7 '10 at 17:17
  • If I search for "Foxit Software" (without the quotes) I get no results for a folder despite the fact that there is a folder with this exact name in /Users/<username>/Library/Application Support. None of the folders in that path are hidden. – Jess Riedel Nov 28 '17 at 5:24
6

Using terminal, you can do:

mdfind kind:folder "farm-animal-type"
0

On Mac OS 10.10.5 (Yosemite), in Finder, click on the "+" button at the top right, just below the search string. Set "Type" = "Folder" and you're set!

0

As suggested by @John T and @macek above, Use Spotlight. It's much faster than using the wildcard in the terminal with find or locate commands if your folder name is having common file/application tags, such as searching for a folder with tags Python or Java. In your current case, it should work fine with any approach, but it's noteworthy and should be kept in mind.

  • Hi Akhil and welcome to Superuser! Great to see that you want to contribute to this site. This site aims to be a question/answer repository and is trying to reduce duplication. Your answer seems very similar to this answer (as you note yourself), so I'm not sure if it's of added value. Next time, please consider if your answer is adding something new before posting it. Looking forward to see more of your contributions! – Saaru Lindestøkke Jun 25 at 14:38
  • @SaaruLindestøkke duly noted. Just to be clear my answer is a detailed one. I've even mentioned the two similar answers in mine. Thanks! – Akhil Verma Jun 26 at 12:10

Your Answer

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