Here are several ways to do replacement on Linux:
- Output the replacing result to the same file by sed with option -i
- Another substitution method is to use the command tr
- Or, you can do replacement within vi
[oracle@test ~]$ sed -i 's/Alex Wu/Steven Li/g' temp.txt
Output the replacing result to another file by sed without option -i.
[oracle@test ~]$ sed 's/Alex Wu/Steven Li/g' temp.txt > temp1.txt
[oracle@test ~]$ cat temp.txt | tr -s 'r' 'n' > temp1.txt
[oracle@test ~]$ vi temp.txt
...
:%s/Good/Bad/g
This means that you want to substitute all "Good" string with "Bad" string globally in this whole document.