【发布时间】:2020-04-18 16:31:30
【问题描述】:
我正在尝试运行 sed 命令,通过排除以“This”开头的行来显示文件中的文本。我可以使用 grep 执行相同的操作,但使用 sed 时遇到问题。我尝试了以下命令:
sed -n '/[^This]/p' example
它正在打印整个文件。
This is first line of example text
It is a text with erors.
Lots of erors.
So much erors, all these erors are making me sick.
This is a line not containing any erorrs.
This is the last line.
提前感谢您的帮助!
【问题讨论】: