使用tail命令探索文件

jin*_*ngo 1 unix linux

我正在使用tail -f来"实时"查看日志文件.该怎么做才能只查看包含127.0.0.1的行?

thi*_*ton 7

grep 是你的朋友:

 tail -f foo | grep '127\.0\.0\.1'
Run Code Online (Sandbox Code Playgroud)