2

I run tcpdump as follows:

$ sudo tcpdump -i eth0 -w dump.pcap host 1.2.3.4
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes

Is there a way to see how many packets it has captured so far? Apparently BSD allows for a status signal, but I'm on Linux.

2 Answers 2

3

You are probably looking for the -v option of tcpdump. From man tcpdump:

   -v     ...
          When writing to a file with  the  -w  option,  report,   
          every 10 seconds, the number of packets captured.

Sample output:

$ tcpdump -v -i eth0 -w dump.pcap
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
Got 227

Note that contrary to what the man page says, the "Got X" gets refreshed every second on the machines I could test this (using tcpdump 4.9.2).

0

You can make tcpdump print the output on stdout and pipe it to tee. This way you can both save the output into the file and have it printed out on stdout. Once you have this, you can use pv/grep/tail or anything like that to track progress

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .