![Tcpdump icmp echo](https://kumkoniak.com/16.jpg)
![tcpdump icmp echo tcpdump icmp echo](https://i0.wp.com/codeinlet.com/wp-content/uploads/2021/04/image-22.png)
Tcpdump will, if not run with the -c flag, continue capturing packets until it is interrupted by a SIGINT signal (generated, for example, by typing your interrupt character, typically control-C) or a SIGTERM signal (typically generated with the kill(1) command) if run with the -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. In all cases, only packets that match expression will be processed by tcpdump.
![tcpdump icmp echo tcpdump icmp echo](https://img2020.cnblogs.com/blog/1179840/202006/1179840-20200616233323796-12890160.png)
It can also be run with the -V flag, which causes it to read a list of saved packet files. It can also be run with the -w flag, which causes it to save the packet data to a file for later analysis, and/or with the -r flag, which causes it to read from a saved packet file rather than to read packets from a network interface. Tcpdump prints out a description of the contents of packets on a network interface that match the Boolean expression the description is preceded by a time stamp, printed, by default, as hours, minutes, seconds, and fractions of a second since midnight. Read from a given dump file: tcpdump -r dumpfile.pcap.Capture all traffic except traffic over port 22 and save to a dump file: tcpdump -w dumpfile.pcap port not 22.Capture the traffic of a network: tcpdump net 192.168.1.0/24.Capture the traffic from a specific interface, source, destination and destination port: tcpdump -i eth0 src 192.168.1.1 and dst 192.168.1.2 and dst port 80.Capture the traffic from or to a host: tcpdump host.Capture all TCP traffic showing contents (ASCII) in console: tcpdump -A tcp.Capture the traffic of a specific interface: tcpdump -i eth0.List available network interfaces: tcpdump -D.Dump traffic on a network Examples (TL DR)
![Tcpdump icmp echo](https://kumkoniak.com/16.jpg)