How do I exclude a certain folder name from the Eclipse file search (CTRL + H
)? For example if I want to search all files, but exclude any files in a folder called FolderName
(and its subdirectories), what can I enter in the file name pattern to accomplish this?
I have a couple options for you.
First Option
If it is feasible, select the range of folders you want to search, then Ctrl - click any folders you want to exclude from the search. Press Ctrl - H to open file search, then under Scope
choose the Selected Resources
option.
Second Option
Right-click the folder to exclude, select properties, check Derived
, and apply. This works because by default File Search will exclude derived resources. After the search you can undo the Derived
setting.
Note that I'm not familiar enough with the inner workings of Eclipse to be certain about potential side effects of temporarily marking files as derived like this, but I suspect it should be okay.
After more digging, I found yet another workaround which might be helpful for anyone with this same issue.
You can define a Working Set that includes just the directories you want to search. In the File Search dialog, select Working Set in the Scope section (at the bottom), then Choose..., then use New... to define your Working Set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With