【发布时间】:2012-03-21 11:05:30
【问题描述】:
我是sed 的新手,我有以下问题。在这个例子中:
some text here
blah blah 123
another new line
some other text as well
another line
我想删除除包含字符串'text' and 或字符串'blah' 之外的所有行,所以我的输出文件如下所示:
some text here
blah blah 123
some other text as well
任何提示如何使用sed 完成此操作?
【问题讨论】:
-
答案必须使用sed吗? grep 会很容易做到这一点。
标签: sed