sed replace character in file and save to new file code example Example: sed replace in file sed -i 's/foo/bar/g' hello.txt