use sed command to edit a file , replace a word by another code example Example: sed replace in file sed -i 's/foo/bar/g' hello.txt