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.

My goal is, that the finder search finds .c files that have the search keywords in it. It seems to work for others but not for me:

enter image description here

but searching for main doesn't yield any results:

enter image description here

What do I need to change/fix to get it to work?

share|improve this question
    
What makes you think that Spotlight doesn't already do that? I just run some tests here and Spotlight found text in .c/.h files without problems. –  patrix Aug 15 '13 at 16:21
    
I would have to agree with patrix. I did a search for a string contained within my C source code, and my Spotlight search showed them in the list. Is it possible that you don't have Developer indexed in your Spotlight settings? –  Dave Aug 15 '13 at 16:23
    
You both are totally right. I thought, Spotlight behaves the same as the finder search. But, apparently it doesn't. My problem is, that the finder search doesn't find text inside .c files for example. (I will modify the question) –  mirco.widmer Aug 15 '13 at 16:24
    
Uhh, Finder search on .c/.h works as expected for me as well (see d.pr/i/X0iH), it's based on the same meta data as Spotlight anyway. –  patrix Aug 15 '13 at 18:17
1  
Have you installed Xcode? –  Mark Aug 15 '13 at 23:18

2 Answers 2

See attached image:

C_search

When I search with the parameters Kind:C source code and for the term Bootstrap, I am able to locate all of my C files that contain that string.

Is this the functionality that you are wanting that you don't have?

share|improve this answer
    
It certainly would be better than nothing, but not even that works. My goal is to have the identical behaviour like Spotlight but just for the current folder (i have the option to search in the current folder activated). –  mirco.widmer Aug 15 '13 at 22:07

For searching source code ack is probably the best tool for the job.

http://beyondgrep.com

share|improve this answer
    
I agree, Mark, but since the OP asked about Finder, I figured I would focus on that. –  Dave Aug 15 '13 at 21:53
1  
That's why I provided an alternative. For precision and flexibility Spotlight doesn't work as well as a real grep style search. –  Mark Aug 16 '13 at 15:03

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.