一、將當前目錄下包含jack串的文件中,jack字符串替換爲tom .net
sed -i "s/jack/tom/g" `grep "jack" -rl ./`blog
二、將某個文件中的jack字符串替換爲tom字符串
sed -i "s/jack/tom/g" test.txttest
參考鏈接:http://blog.csdn.net/lizhi200404520/article/details/7968483sed