How can I make tcpdump stop the capture after a certain number of packets captured?

Solution 1:

See man tcpdump:

-c Exit after receiving count packets.