$ sed -i.orig -e 's/hoge/fuga/g' test.txt
次と同じ
$ mv test.txt test.txt.orig $ sed -e 's/hoge/fuga/g' test.txt.orig > test.txt