ssh尾部输出行仅带有关键字

sve*_*n30 2 ssh tail

我正在尝试在ssh命令提示符下拖尾一个大文件,但我需要对其进行过滤,因此它仅显示其中包含特定关键字的行。

我目前正在使用此命令进行尾部操作。

# tail /usr/local/apache/logs/access_log
Run Code Online (Sandbox Code Playgroud)

如果可能,请告诉我要添加到此命令中以完成此操作的内容。

vee*_*vee 5

您可以通过管道传递tail和使用grep。至

过滤器,因此它仅显示其中包含特定关键字的行

你可以做:

tail /usr/local/apache/logs/access_log | grep "keyword" 
Run Code Online (Sandbox Code Playgroud)

keyword用关键字替换的位置。