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:

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

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.

  • Interesting question, wonder why !
    – Ruskes
    Commented Jul 28, 2013 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. Commented Jul 29, 2013 at 2:29
  • 1
    Very surprised that all the answers here involve using something other than Finder. Is there really no way to do this from within Finder?! Commented Nov 2, 2018 at 0:32

4 Answers 4


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.

  • 2
    This was far easier than messing around with the Finder
    – jcollum
    Commented Dec 26, 2018 at 18:43
  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.

  • Point number 2 is actually the answer. Too bad we need to dance around and there's no way to simply check a box for this. Would actually make a search very simple (not deep/recursive).
    – bauerMusic
    Commented Apr 7, 2018 at 7:25

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.


I´m thinking that if you tag a colour in all folders in a particular location, you can in the search bar type the name of the folder that you are searching and type the colour you tagged, and finder look for only this label colour. So your finder results in not showing subfolders.

  • Thanks for the suggestion. Do I understand correctly that if I have 20 subfolder, I would need to go to each folder, select all files and tag with a color? That sounds like a lot of work to find the file in the top folder... Commented Sep 19, 2021 at 20:41
  • Hi Neil. You should tag only the top folder (I suppose this is the folder that contains the file you are looking for). On this way Finder only looks for this folder. If you have many subfolders in a particular location (this is simple if this folders are on the same location) you can tag this folders too (that will include this folders in the searching) Commented Sep 22, 2021 at 8:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .