1、修改某文件中的内容:将oldstring修改为newstring
sed -i "s/oldstring/newstring/g" test.txt
如果将oldstringXXX修改为newstring:
sed -i "s/oldstring*/newstring/g" test.txt
2、将某个目录中所有含有oldstring字符串的文件中的oldstring修改为newstring
sed -i "s/oldstring/newstring/g" `grep "jack" -rl ./`