3 for file in `ls ./*.*`
4 do
5 mv $file `echo $file|sed 's/IM_21R_ID331/1M21R_ID331/g'`
6 done
7 sed -n '/1B21M_ID228/p' HXMT*
8 sed -i 's/1B21M_ID228/1M21R_ID331/' HXMT*
注释:名字中如果有空格,会非常麻烦,因为默认的分隔符就是空格
3 for file in `ls ./*.*`
4 do
5 mv $file `echo $file|sed 's/IM_21R_ID331/1M21R_ID331/g'`
6 done
7 sed -n '/1B21M_ID228/p' HXMT*
8 sed -i 's/1B21M_ID228/1M21R_ID331/' HXMT*
注释:名字中如果有空格,会非常麻烦,因为默认的分隔符就是空格