gsed comand store file

C++
sed 's/Hello/Hi/g' file-name > file
sed -i 's/Hello/Hi/g' file-name
Source

Also in C++: