command line find and replace string in text file code example Example: linux replace string in all files sed -i 's/old-text/new-text/g' input.txt