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