Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

For Linux, sed and find are an easy option to search and replace in many files including subdirectories. Is there a way to do the same in Windows (with or without PowerShell)?

share|improve this question

5 Answers 5

up vote 3 down vote accepted

While PowerShell is certainly capable of this, have you considered using the UnxUtils Win32 ports?


share|improve this answer

Many text editors/programming IDEs include advanced Find/Replace functionality that will do exactly what you're looking for. A couple that I have used and have been pleased with include Notepad++ and Visual Studio

share|improve this answer
I love Notepad++ however for this task I need a scripting utility –  mjn May 10 '10 at 19:02

When I needed it, I used Windows Grep application http://www.wingrep.com that not only searches, but replaces as well

share|improve this answer

My favourite utility is fart.exe. (Find And Replace Text.exe)

Here is a link http://fart-it.sourceforge.net/

Gotta love the logo...

share|improve this answer

My fav for this purpose is SFK (Swiss File Knife).

I've employed it for finding injected code patterns in files on web servers searching from the drive root all the way through the subdirectories.

Works great.


share|improve this answer

Your Answer


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.