Okay, question: Let’s say I have a folder with a really large number of individual html files in it, and I want to search all of them, collectively, for a particular phrase and end up with a list of which files contain that phrase. There has to be some easy way of doing this, right?

Ah, dangit, just read you were on Windows. Dunno anything about that, sorry. Please disregard my grep comment.

in conclusion, the easy solution is “get off windows”

In powershell 3.0 (AKA bestshell):

ls *.html | sls “the phrase” > outputFile.txt

If you don’t have powershell 3.0, you might not have the same aliases so instead:

get-childitem *.html | select-string “the phrase” > outputFile.txt

edit: If you want JUST the filenames:

(get-childitem *.html | select-string “the phrase”).Filename > outputFile.txt

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s