2
我想跟随一个文件,但tail -f
总是从最后10行开始。有没有办法输出整个文件,然后按照?tail -f从整个文件开始
我的目标是在日志中查找所有匹配的字符串,例如tail -f streaming_log | grep "string"
。但也包括以前的所有行。
我知道我可以做tail -f -n 10000 file
但我不想先计算行数。
我想跟随一个文件,但tail -f
总是从最后10行开始。有没有办法输出整个文件,然后按照?tail -f从整个文件开始
我的目标是在日志中查找所有匹配的字符串,例如tail -f streaming_log | grep "string"
。但也包括以前的所有行。
我知道我可以做tail -f -n 10000 file
但我不想先计算行数。
-n +<line>
允许你指定一个开始线(1
为基础):
tail -f -n +1 file # output entire file, then wait for new content