sed学习备忘录

来源:互联网 发布:淘宝客户资源管理分析 编辑:程序博客网 时间:2024/06/10 20:44
<pre name="code" class="cpp">cat test.txt |grep "^r....." >test1.txt提取r.....开头的行 sed -ne 's/\(r.....\).*/\1/p' <test1.txt  >test2.txt删除r.....之外的文字,这里括号没有显示出来sed -ne 's/^r\(.....\).*/\1/p' <test.txt提取以r开头的之后5位字符,这里()没有显示出来




0 0
原创粉丝点击