1

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.

anonymous-one
  • 958
  • 4
  • 26
  • 43

1 Answers1

2

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,240
  • 8
  • 15