Search code examples
tcpdump

tcpdump: How do I suppress packet information?


When I kill a tcpdump process, I get the following three lines:

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

I am piping the output of tcpdump into a txt file and want to keep my terminal clean. Is there a way to suppress this information?


Solution

  • From this question here, the tcpdump stats and header lines are a part of stderr. So, if you want to suppress this information and store the packet information in a file, you can do:

    tcpdump 2> /dev/null > output.txt
    

    Using /dev/null/ will discard the stderr output.