Sed使用总结

简介: Sed使用总结

1.把 10.104.5.71替换成10.104.5.98,

 

<!-- redis配置 type 1表示游戏库,2表示全局库,3表示角色库 5msg-->  
  <cache> 
    <entry type="1" ip="127.0.0.1" port="6379" index="0"/>  
    <entry type="2" ip="10.104.5.98" port="6379" index="0"/>  
    <entry type="5" ip="10.104.5.98" port="6380" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6379" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6380" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6381" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6382" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6383" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6384" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6385" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6386" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6387" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6388" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6389" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6390" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6391" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6392" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6393" index="0"/>  
    <entry type="3" ip="10.104.5.71" port="6394" index="0"/> 
  </cache>

 

 

 

sed -i 's/10.104.5.71/10.104.5.98/g' game-config.xml

 

查看文件前100行

head -n 100 file.log

看文件最后100行

tailf -n 100 file.log

目录
相关文章
|
19天前
|
Unix Windows Perl
sed具体的介绍
sed具体的介绍
16 2
|
人工智能 移动开发 Unix
三剑客之 sed
三剑客之 sed
|
移动开发 开发工具 Perl
|
JavaScript Java Shell
|
JavaScript Java Shell
|
机器学习/深度学习 Unix Shell