2

We have a small script that essentially does the following:

A) Capture packets using tcpdump and pipe to output file.
B) Run our own clean + sort script on output file.
C) Display results using | sort | etc etc...

So, we were wondering if there is a tcpdump parameter that sets the number of packets tcpdump will capture before exiting?

Thanks.

1 Answers1

3

tcpdump -c [count] is the option you're looking for.

-c flag, it will capture packets until it is interrupted by a SIGINT or SIGTERM signal or the specified number of packets have been processed.

jirib
  • 1,270