#perl -ne 's/text/newtext/g' /path/to/file