1

我正在尝试分析日志文件。我正在寻找可能满足以下要求的正则表达式:

LOG: https://localhost/a
LOG: https://remotehost/x
LOG: https://localhost/b
LOG: https://localhost/c
LOG: https://remotehost/a

上面是一个日志文件的例子。问题:我怎样才能通过日志文件 grep,这样我只得到不包含的行:

https://localhost

结果应该是:

LOG: https://remotehost/x
LOG: https://remotehost/a
4

1 回答 1

5

采用grep -v <word> <filename>

grep手册(FreeBSD):

-v, --invert-match
    Invert the sense of matching, to select non-matching lines.
于 2013-02-11T13:01:56.977 回答