Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The built-in Windows Search tool will apparently not search within PHP files. I cannot find the files named *.php containing text "some_function_name" that I know are there.

Search is complete. There are no results to display.

What's a good alternative to the built-in "Search for Files and Folders" tool in Windows?

Search for Files and Folders

share|improve this question

migrated from stackoverflow.com Apr 28 '10 at 5:13

20 Answers

findstr /s [string] [files]

findstr /? for more information, including the regex syntax you can use.

share|improve this answer
1  
An example of usage would be: c:\> findstr /s /I /C:some_function_name" *.php /s is recursive search, /I is case-insensitive, /C is the string to look for. – Joe Pineda Sep 30 '08 at 20:58
show 1 more comment

To get Windows Search to search all file types use Chris Sells' .reg file ("Filter Files With Unknown Extensions For XP")

share|improve this answer

I use the free version of Agent Ransack. It lets me use regular expressions and shows me the lines of the file that match.

share|improve this answer
show 2 more comments

Install Cygwin. Use grep. You also get the benefit of all the other cool Linux tools like vim and sed that will make your life easier and increase your productivity.

share|improve this answer

Windows Grep - an excellent tool on Windows.

share|improve this answer

Google Desktop. There's an addin that is great for text based files.

share|improve this answer
show 1 more comment

You can tell Windows Desktop Search to look in PHP files. It also doesn't look in CS files by default.

Go to Control Panels > Indexing Options > Advanced > File Types tab. On the bottom of the form, enter "php" and click "Add New Extension". Set the type to "Index Properties and File Contents".

share|improve this answer

Copernic Desktop Search is good. Same functionality as Google desktop search, but some people don't like the way GDS phones home. Unfortunately there was an app it didn't play nice with on my work machine, so I had to uninstall it.

share|improve this answer

Ack is a pretty nice command line tool implemented in Perl.

share|improve this answer

I haven't seen anyone recommend Copernicus yet.

share|improve this answer
show 1 more comment

If you have Notepad++ or Dreamweaver, they'll do that for you.

share|improve this answer

To search for files based on its contents I use Notepad++. Most of the time I already have it open anyway.

share|improve this answer

I don't have any trouble searching in PHP files on my Windows XP machine. It must be some strange setting excluding PHP files maybe. There is a shareware program called WindowsGrep that works pretty well.

share|improve this answer

You can just modify Windows XP to search ALL textual files for text. See Windows XP Search Bug.

share|improve this answer

Have you tried using grin? It's a command-line program written in Python. It runs under Windows, Cygwin, Linux, etc.

share|improve this answer

To solve this (and similar) problem(s), put this lines in a batch file (locate.bat):

@echo off
pushd \
echo.
echo PLEASE STAND BY: LOOKING FOR INSTANCES OF %1 ...
echo.
dir %1 /b /s /p
popd

If you place this batch somewhere on your path, it will work like the linux locate command and find matches within the current drive file system -- locate.bat *.php will work, for example...

share|improve this answer

Placer Search & Replacer searches PHP files and other files. It is pretty lightweight and fast.

share|improve this answer
dir /s *.php

Execute that in the directory you want to find stuff in and in subfolders.

share|improve this answer
2  
I don't have 100 to downvote you , but this doesn't answer the poster's question. – sep332 Nov 6 '08 at 17:47

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.