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