【问题标题】:tcpdump: How do I suppress packet information?tcpdump:如何抑制数据包信息?
【发布时间】:2021-11-11 20:47:43
【问题描述】:

当我杀死一个 tcpdump 进程时,我得到以下三行:

NN packets captured
NN packets received by filter
NN packets dropped by kernel

我正在将 tcpdump 的输出通过管道传输到一个 txt 文件中,并希望保持终端清洁。 有没有办法隐藏这些信息?

【问题讨论】:

    标签: tcpdump


    【解决方案1】:

    this question here 开始,tcpdump 统计信息和标题行是stderr 的一部分。所以,如果你想抑制这个信息并且将数据包信息存储在一个文件中,你可以这样做:

    tcpdump 2> /dev/null > output.txt
    

    使用/dev/null/will discard the stderr output

    【讨论】:

      猜你喜欢
      • 2015-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-15
      • 2021-12-30
      • 2014-09-17
      • 1970-01-01
      相关资源
      最近更新 更多