sed -i 's/old/new/g' filename vi/vim里面 :%s/old/new/g
修改文件中第n行到第m行以new代替old sed -i 'n,ms/old/new/g' filename