$ cat hello.txt
hello linux shell world
$sed -i 's/linux/LINUX/g' hello.txt
$ cat hello.txt
hello LINUX shell world
在写入文件时生成一个备份文件:
$ sed -i.bak 's/LINUX/linux/g' hello.txt
$ ls
hello.txt hello.txt.bak
$ cat hello.txt
hello linux shell world
$ cat hello.txt.bak
hello LINUX shell world