Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How can I force Finder to only search the current folder, ignoring the contents of all the sub-folders?
I don't want to exclude the sub-folders permanently from Spotlight, just for a certain search.

The reason I want to do this is that I sometimes have a folder with sub-folders that contain files/folders that are identically named. A simplified example is shown below:

main
|
|-config.txt
|
|-folder 1
|  |
|  |-config.txt
|
|-folder 2
   |
   |-config.txt

When I'm in main and hit CMD+F and type config.txt I get three files. I don't want to click every file to see which one is in main and which in another folder, so ideally the sub-folders wouldn't show up in this search.

share|improve this question
    
Interesting question, wonder why ! –  Buscar웃 Jul 28 '13 at 18:07
    
I've been wondering the same thing. Cmd-option-f gives access to some more search options but excluding subfolders doesn't seem available. –  Neil Neyman Jul 29 '13 at 2:29

3 Answers 3

up vote 1 down vote accepted

Use Unix find as follows

find . -maxdepth 1 -name config.txt -print

In Terminal, type man find for details.

If you do this often, you can make it into a shell function.

share|improve this answer
  1. There is a product called Path Finder 6 that offers a feature called "filters and selections," demonstrated here.

  2. You could try selecting all the items in the folder you are searching and applying a Label, then perform a Spotlight search for your item "AND" the additional criteria of "file label" by holding down the option key while clicking on the plus sign.

share|improve this answer

Possible workaround, although this doesn't really answer the question. Not sure if there's a built-in option for this.

  1. In list view, make sure all folders are collapsed --cmd-a (select all) and command-left-arrow are shortcuts for this.

  2. Without selecting the search box or using cmd-f, begin typing the name of the file "config.txt" and this will select that file in your current directory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.