# grep-ing (file searches) in Windows XP

**URL:** <https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422>\
**Category:** Factual Questions\
**Created:** [August 10, 2005, 9:07am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422 "2005-08-10T09:07:47Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Small\_Clanger](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Small\_Clanger](https://boards.straightdope.com/u/Small_Clanger)\
**Post date:** [August 10, 2005, 9:07am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/1 "2005-08-10T09:07:47Z")

</div>

How do you search for a text string in all files regardless of extension?

I’m new to XP so maybe I’m missing something obvious. But. Searching in XP seems to limit itself to “known” file types. How do you (can you?) persuade it to look in every file regardless? Even putting _._ as the filename and searching in _all files and folders_ doesn’t work.

Help!

---

<div class="post-metadata">

**Author:** ![Ximenean](https://avatars.discourse-cdn.com/v4/letter/x/aca169/32.png) [@Ximenean](https://boards.straightdope.com/u/Ximenean)\
**Post date:** [August 10, 2005, 9:37am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/2 "2005-08-10T09:37:52Z")

</div>

Have you included hidden files and system files, under “More advanced options”?

Or you could get a Windows version of grep. Or cobble a script together with the FIND and FOR commands (I don’t think FIND can search subdirectories).

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [August 10, 2005, 9:39am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/3 "2005-08-10T09:39:16Z")

</div>

How you get to it depends on how you’ve got your search dialog customised (if at all); if you’re looking at a cartoon dog, then it’s straight-out-of-the-box.

Anyway, you want to click the ‘All files and folders’ thing, then a couple of text boxes will pop up; one of them is labelled ‘containing text:’ or something; that’s the one you want - it can be used in conjunction with the others to limit the scope of the search.

Unlike grep though, you just get a list of files where the string was found; you’ll still have to open them all and find it in context.

---

<div class="post-metadata">

**Author:** ![Fredescu](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@Fredescu](https://boards.straightdope.com/u/Fredescu)\
**Post date:** [August 10, 2005, 9:52am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/4 "2005-08-10T09:52:04Z")

</div>

Wow. I’ve worked in Windows based support roles for years and had never realised the default search limited ‘Containing Text’ to extensions it recognised. I tested by making two text files with the same one word in each and deleting the extension of one of the files. Search only found one of the files. Once I added the .txt extension, the second file appeared in the search results without even having to do another search. I feel like my world has been turned upsidedown ☹

Have a look at [these](http://support.microsoft.com/default.aspx?scid=KB;EN-US;309173) [links](http://www.dougknox.com/xp/tips/xp_bad_search.htm) for possible workarounds.

[sub]I’m going to go and lie down[/sub]

---

<div class="post-metadata">

**Author:** ![Futile\_Gesture](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@Futile\_Gesture](https://boards.straightdope.com/u/Futile_Gesture)\
**Post date:** [August 10, 2005, 9:57am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/5 "2005-08-10T09:57:52Z")

</div>

[Wingrep](http://www.wingrep.com/)

---

<div class="post-metadata">

**Author:** ![Small\_Clanger](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Small\_Clanger](https://boards.straightdope.com/u/Small_Clanger)\
**Post date:** [August 10, 2005, 10:20am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/6 "2005-08-10T10:20:56Z")

</div>

> [@Mangetout](#):
>
> . . . if you’re looking at a cartoon dog, then it’s straight-out-of-the-box.

The first thing I did was kill the dog.

**Fredescu** Thanks for the links, I’ll try one one those.

It seems searching in XP is known to be crap by everyone _including Microsoft_.

Jeez.

I do already have a POSIX grep for NT, I’ll try that on the new XP box.

And it looks like I’ll be downloading wingrep.

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [August 10, 2005, 10:33am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/7 "2005-08-10T10:33:51Z")

</div>

> [@Small Clanger](#):
>
> The first thing I did was kill the dog.

I nearly put my fist through the screen in blind fury when I clicked ‘turn off the cartoon dog’ and, rather than just _disappearing_ (like I’d asked), it stood up, wagged its tail and looked about, then spent a few seconds wandering off.

---

<div class="post-metadata">

**Author:** ![Small\_Clanger](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@Small\_Clanger](https://boards.straightdope.com/u/Small_Clanger)\
**Post date:** [August 10, 2005, 10:44am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/8 "2005-08-10T10:44:10Z")

</div>

Yup folks, Microsoft use your CPU cycles and disk space to animate the turning off of the cartoon “helper”\*\*\*\*\* but they ship an OS with a crippled search utility.

Update: Method 2 from **Fredescu** ’s first link seems to have fixed it. But what a palavar. The second link involved running vb scripts to fiddle with the registry, um, no thanks.  
\*\*\*\*\* didn’t Clippy used to wink or something?

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [August 10, 2005, 11:29am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/9 "2005-08-10T11:29:03Z")

</div>

This is mentioned in Fred’s second link, but I don’t think it’s what you did Mange…

I now swear by ‘[Agent Ransack](http://www.mythicsoft.com/agentransack/)’ when it comes to searching inside files. Very snazzy little program, and free!!

Fun to use too… I often find that I’m muttering under my breath. “Search this folder? Nah, that won’t find what I’m looking for, I shall have to RANSACK it!!” Or something not quite as intelligible to the same effect.

😃

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [August 10, 2005, 3:09pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/10 "2005-08-10T15:09:17Z")

</div>

Many (free) text editors will seach files for you.

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [August 10, 2005, 3:10pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/11 "2005-08-10T15:10:34Z")

</div>

They will SEARCH files too. 🙂

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [August 10, 2005, 4:25pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/12 "2005-08-10T16:25:11Z")

</div>

> [@ccwaterback](#):
>
> They will SEARCH files too. 🙂

Are you talking about searching open files? Or searching through a directory or directory tree and finding ALL matches for a search term, which is a different kind of thing, and sounds like what the OP was asking for.

I have a few MDI text editors that will do a global search on their open files. But I’m not going to drop more than a few dozen files into it to do a search. (I might use a tool like that for global search-and-replace after I’ve found the files by another tool.)

But with agent ransack I can tell it to search a drive that has tens of thousands of files and get the results back in a minute or few, without having my system slow to a crawl in the meantime. (Depending on how big the files are of the appropriate file extension or whatever, of course. 😃 )

---

<div class="post-metadata">

**Author:** ![scm1001](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@scm1001](https://boards.straightdope.com/u/scm1001)\
**Post date:** [August 11, 2005, 11:15am UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/13 "2005-08-11T11:15:54Z")

</div>

For searching within just about any sort of file I use copernic desktop, which is a very fast (almost instantaneous) search, but does seem to use a lot of resources in the background collating stuff  
[www.copernic.com/en/products/desktop-search/](http://www.copernic.com/en/products/desktop-search/)

---

<div class="post-metadata">

**Author:** ![ccwaterback](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@ccwaterback](https://boards.straightdope.com/u/ccwaterback)\
**Post date:** [August 11, 2005, 12:38pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/14 "2005-08-11T12:38:51Z")

</div>

> [@chrisk](#):
>
> Are you talking about searching open files? Or searching through a directory or directory tree and finding ALL matches for a search term, which is a different kind of thing, and sounds like what the OP was asking for.

Searching through files, open or not. There is a menu item for searching, one of the options is search “files” and another option is “traverse directory trees”. I use Texpad, it works well for “grepping”.

[http://www.textpad.com/](http://www.textpad.com/)

---

<div class="post-metadata">

**Author:** ![leandroc76](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@leandroc76](https://boards.straightdope.com/u/leandroc76)\
**Post date:** [August 11, 2005, 12:51pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/15 "2005-08-11T12:51:06Z")

</div>

I’m not completely sure of this but I believe Vista, will have something similar to Mac OS X Tigers’ [“spotlight”](http://www.apple.com/macosx/features/spotlight/).

This should solve your problems come end of 2006 or 2007. 😉

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [August 11, 2005, 2:03pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/16 "2005-08-11T14:03:31Z")

</div>

> [@leandroc76](#):
>
> I’m not completely sure of this but I believe Vista, will have something similar to Mac OS X Tigers’ [“spotlight”](http://www.apple.com/macosx/features/spotlight/).
> 
> This should solve your problems come end of 2006 or 2007. 😉

Assuming the feature isn’t dropped in the meantime.

Shorthorn: Where can’t it go _today_? 😉

If you want a _real_ grep for Windows, installing [Cygwin](http://www.cygwin.com/) is the best option:

> [@Cygwin page](#):
>
> Cygwin is a Linux-like environment for Windows. It consists of two parts:
> 
> # A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
> 
> # A collection of tools, which provide Linux look and feel.
> 
> The Cygwin DLL works with all non-beta, non “release candidate”, ix86 32 bit versions of Windows since Windows 95, with the exception of Windows CE.

The downside to Cygwin is that the tools aren’t graphical and the default Windows command line sucks worse than a two-dollar hooker. Unless you want to upgrade to bash, which I recommend you do if you spend any time applying batch changes to large groups of text files, you might be better off with a graphical program.

---

<div class="post-metadata">

**Author:** ![spinky](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@spinky](https://boards.straightdope.com/u/spinky)\
**Post date:** [August 11, 2005, 5:48pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/17 "2005-08-11T17:48:17Z")

</div>

Nobody’s mentioned **findstr.exe** yet? It comes with windows, and is a command-line text search tool. It doesn’t have the same semantics as grep, but it’s useful in similar ways e.g.:

c:\> findstr /spin SomeFunction \*.c \*.h \*.cpp \*.cs

(note that the /s makes it recursively search files in subdirectories, whereas with grep you’d need to use it in conjunction with ‘find’ or something)

---

<div class="post-metadata">

**Author:** ![groo](https://avatars.discourse-cdn.com/v4/letter/g/ecd19e/32.png) [@groo](https://boards.straightdope.com/u/groo)\
**Post date:** [August 11, 2005, 6:05pm UTC](https://boards.straightdope.com/t/grep-ing-file-searches-in-windows-xp/316422/18 "2005-08-11T18:05:02Z")

</div>

Thanks to y’all for the links showing how to turn on the indexing function; this has been vexing me for some time.
