There certainly is a *nix command line to do that stuff, but I don't know it. Wait for TheDarkness to wake up and he might have a thought.
In the mean time, you can make an executable PHP script as your own command line utility. Consider:
#! /usr/local/bin <---- this points to YOUR php instance (find it with "which php")
<?php
$inputFile = $_SERVER['argv'][1];
$originalStr = $_SERVER['argv'][2];
$replaceStr = $_SERVER['argv'][3];
$buff = file_get_contents($inputFile);
file_put_contents($inputFile, str_replace($originalStr, $replaceStr, $buff));
?>
Assuming you put this code into a file name "convert.php" you'd first need to make it executable with
chmod 755 convert.php
and then to execute it you'd something like:
./convert.php theInputFile.txt crap crud
This example would convert every instance of "crap" in a file and convert it to "crud," writing the output back to the original file. Clearly this is an overly simple example, and you'd probably want to add checking to make sure the input file is OK, or specify an optional output file, or perhaps the ability to say:
./convert.php inputFile.txt Ô O
... which is a captial "O" with a circumflex, converted to a normal capital O. Or you could add FILES as input for search and replace, so that you could have lots of things to convert all in one pass. The possibilities are endless.
Hope this helps, ping back if you need more,
/p