Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在 ssh 命令提示符中跟踪一个大文件,但我需要对其进行过滤,以便它只显示其中包含特定关键字的行。
我目前正在使用这个命令来跟踪。
# tail /usr/local/apache/logs/access_log
如果可能的话,请让我知道我会在这个命令中添加什么来完成这个。
您可以通过管道输出tail并使用grep. 至
tail
grep
过滤器,因此它只显示其中包含特定关键字的行
你可以这样做:
tail /usr/local/apache/logs/access_log | grep "keyword"
您将替换keyword为您的关键字的位置。
keyword