How to Save sed Output Directly to a File 2022-05-08 42 words - 1 min read You have 3 options here: Option 1: use tee with sed 1 sed 's/Hello/Hi/g' file-name | tee file Option 2: use > with sed 1 sed 's/Hello/Hi/g' file-name > file Option 3: use sed with -i option 1 sed -i 's/Hello/Hi/g' file-name