tail -f 和tail -F的区别

http://flume.apache.org/FlumeUserGuide.html

flume抓取 exec 的command 官网有如下建议:

以下内容来自:http://blog.163.com/yinlong_bgp/blog/static/21733277201031503321806/

tail -f,当文件被删除或移走后,即使重新创建的文件也不会再出现新文件内容。如下
  (第一个窗口)
  [root@cftest2 ~]# tail -f messages.3
  helll test2
 
  (第二个窗口)
  [root@cftest2 ~]# rm messages.3
  rm: remove regular file `messages.3'? y
  [root@cftest2 ~]# echo "helll test3">>messages.3
  但是第一个窗口的tail -f 命令不会出现 hello test3

tai -F :当文件删除或者移走后仍然追踪此文件,此时重新创建文件,会继续显示内容:
  [root@cftest2 ~]# tail -F messages.3
   helll test1
   tail: `messages.3' has become inaccessible: No such file or directory


   tail: `messages.3' has appeared;  following end of new file
   helll test2
可以看到,中间删除了messages.3,但重新创建后并输入helll test2,会继续显示出来。

原文地址:https://www.cnblogs.com/sunxucool/p/3954059.html