1

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)?

mjn
  • 933
  • 2
  • 12
  • 26

5 Answers5

3

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

http://sourceforge.net/projects/unxutils/

Goyuix
  • 3,164
  • 5
  • 28
  • 37
2

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

heavyd
  • 482
  • 1
  • 4
  • 15
0

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

lrosa
  • 1,657
  • 14
  • 15
0

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

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

Gotta love the logo...

ggonsalv
  • 390
  • 1
  • 12
0

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.

http://stahlforce.com/dev/index.php?tool=sfk

E W
  • 33
  • 1
  • 3