tags:

views:

331

answers:

15

What is an utility to find code throughout many files or folders. Something akin to PowerGrep but freeware.

A: 

If it's on a Mac, TextWrangler is rather fantastic for multi-file search with grep.

yaauie
+6  A: 

On Windows, there's a "find" command that is similar to grep.

You could also download cygwin or some other Unix emulator and get grep from that.

On Windows, you can also get a standalone version of grep with "unxutils" pack: http://unxutils.sourceforge.net/

Andy White
It baffles me that more people don't use UnxUtils.
Rob Kennedy
A: 

You could also try Komodo Edit. It's a development IDE that supports many languages and has support for recursively searching directories. It's written in Java so it works on "every" platform.

http://www.activestate.com/komodo_edit/

+1  A: 

Since it seems that you're on Windows, Google tells me you can actually use the DOS cmd line:

Recursive Find Text String In Files, Output Line Number:

FOR /R c:\~kenneth %v IN (*.css) DO find /N /I "#banner" "%~fv" >> test.txt

Note the %v is a variable, could be any letter. The quoted "%~fv" expands to the quoted fully qualified pathname. With out quotes Directories with spaces are not processed.

*.css could be any wildcard or even * for all. the >> concatenates the output to one file, in this case test.txt.

Find more examples here: http://kennethhunt.com/archives/000173.html

marzagao
A: 

I have not seen PowerGrep but Visual Studio's "Find in files" works best for me. Also allows "Replace in files" and opens changed files to enable undo.

Vulcan Eager
A: 

Ack provides the same options as grep does, it is aimed at searching in source code, skipping temporary and binary files, core dump. It's a Perl script so can run on Unixes and Windows systems.

philippe
A: 

On recent versions of Windows you'll be well served with findstr.exe which has more features than find.exe.

findstr /nips /c:"unique text string" *.txt

It's not as powerful as grep but it works. The /n gives you line numbers, /m will just give you filenames.

If you forget the file spec it will just wait around for termination.

I'd also recommend learning cmd shell scripting. Start with "for /?".

+1  A: 

I use Notepad++ for this. It even has regex support.

Search->Search in files

Ward Werbrouck
+2  A: 

For Windows I've used Agent Ransack before in the past and it's done a pretty good job.

Phil Nash
+1  A: 

Textpad is a very useful - and cheap - editor that has very good cross-directory searches. It even allows you to quickly go to each of files/lines mentioned in the search results, just by pressing F4 repeatedly.

belugabob
+1  A: 

Eclipse is powerful and is free. Ctrl + Alt + H will search for methods, declarations, types or just free text in any language Eclipse supports. You can even use wildcards and regex.

I've been struggling with finding all the access to some method, for example. Once again, Eclipse does it for me very well: Ctrl + H will open the Call Hierarchy view.

Paulo Guedes
A: 

I know you're asking for freeware, but in case anyone else is browsing this question, I'd recommend a look at Eluent Find. I bought this years ago, and use it daily. I have lots of path plans and extension configs set up for different types of searches I do.

It's aging a bit, doesn't seem to be getting upgraded, but it works as advertised, not sure what they'd add to it. Every year or so I look around around to check the competition, and haven't found anything that works better for me. The path plans are the key feature.

$20.

Scott Bilas
A: 

If you install cygwin, you get the find and grep utilities, which can be used in concert like so:

find <dir> -name '*.cpp' -exec grep -H <pattern> {} \;

Or simply recursive grep, if you don't care about filtering by file-extension:

grep -R <pattern> <dir>
Tom
A: 

Google Desktop. Once it's indexed your files, it's very fast for searching for and within all your files - code or otherwise. You can also search by file type.

If you're using Windows XP, I wouldn't recommend Windows Live Search; it's slow and clunky.

Steve Melnikoff
A: 

Another vote for ack. It's usefulness can not be overstated, it truly is your best friend when dealing with a large code base.

Flemish Bee Cycle