基本用法Sed三剑客搜索匹配文本处理工具sed[OPTION]...{script}[input-file]...[actions]-r:支持扩展正则表达式-n:静默模式-escript1-escript2:指定多个脚本运行-f/path/to/script_file:从指定文件中读取脚本并运行-i:直接修改原文件sed编辑命令d:删除该行ofthepatternspace=:forThelineofthepatternspaceprintthelinenumbera\text:在行后追加文本,\n实现多行追加i\text:在行前插入文本,\n实现多行插入c\text:用文本替换空间中的行p:打印模式空间中的行s/regexp/replacement/:将正则表达式匹配的内容替换为替换g:全局替换i:不区分大小写w/path/to/somefile:将指定内容保存到r/path/from/somefile所指向的文件中/path/to/somefile:在文件的指定位置插入另一个文件的所有内容,完成文件合并。案子
