更改

跳转至: 导航搜索

在vi中进行批量替换

添加18字节, 2018年12月1日 (六) 19:46
无编辑摘要
在vi(vim)中可进行批量替换,脚本格式为:%s/source_pattern/target_pattern/g,其中source_pattern为原字符,target_pattern为替换后的字符,本例中 将小写t替换为 大写T 替换小写t
1.输入“vim anaconda-ks.cfg”打开一个文件。
[[File:ViBatchR2.png]]
== 全局 替换 每行 所有 符合规则的 字符 ==
3.按两次Esc键确保进入底线命令模式(Last line mode)并输入“:%s/t/T/g”并按回车键确定。
1,138
个编辑

导航菜单