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,會繼續顯示出來。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM