sed -i 's/original/new/g'
Detailed description:
sed
= Stream EDitor (Stream Editor)-i
= in-place (ie save back to the original file) (write back source is replaced file)-
The command string:
s
= the substitute commandoriginal
= a regular expression describing the word to replace (or just the word itself)(被替换)new
= the text to replace it with (replace it)g
= global (i.e. replace all and not just the first occurrence) (全部替换)
-
file.txt
= the file name