zoukankan      html  css  js  c++  java
  • 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,会继续显示出来。

  • 相关阅读:
    VM虚拟机Linux和主机数据传输
    Linux CentOS 虚拟机下联网
    SQL 注入漏洞
    BurpSuite 各模块使用
    御剑指纹识别
    C#数组2(多维数组)
    C#数组1
    C#简单的枚举及结构
    ABAP性能1 | LOOP嵌套LOOP代码分析 (转)
    占位符使用(竖式计算)
  • 原文地址:https://www.cnblogs.com/sunxucool/p/3954059.html
Copyright © 2011-2022 走看看