To search: grep is simple and fast. Bundled with Linux, here's a version of Windows not sure about the Mac.
To replace: sed . Here's a version of Windows not sure about the Mac.
Of course, if you want to open a file and see its contents while searching and replacing, you can use emacs to do this. Or ConTEXT . Or vim . Or what you have;)
. .