in reply to find and replace
try:
perl -pi -e 's/foo/bar/gms' File.txt [download]
And see perlrun, to understand the flags -p, -i, and -e
They say that time changes things, but you actually have to change them yourself.
Andy Warhol