tcpdump commands
18 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 18 shown
-
tcpdump -i eth0 -nCapture all traffic on eth0 without DNS resolution
-
tcpdump -i eth0 -w /tmp/capture.pcapSave raw packets to PCAP file for Wireshark analysis
-
tcpdump -r /tmp/capture.pcap -n | head -50Replay and display packets from a saved PCAP file
-
tcpdump -i any host 10.0.0.5 -nCapture only traffic to/from a specific IP
-
tcpdump -i eth0 port 443 -nCapture HTTPS traffic only
-
tcpdump -i any -n port 53Monitor all DNS lookups on any interface
-
tcpdump -i any -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | grep 'GET /'Capture and print HTTP GET request lines
-
tcpdump -i eth0 'host 10.0.0.1 and host 10.0.0.2'BPF filter: traffic between exactly two endpoints
-
tcpdump -i eth0 -vvv -A -s 0 port 5432Full verbose output with ASCII packet content for PostgreSQL
-
tcpdump -i eth0 -c 100 -w capture.pcapStop after capturing 100 packets
-
tcpdump -nn 'tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn'Catch only connection-initiating SYNs (no SYN-ACK) to spot scans or backlog floods
-
tcpdump -nn 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0'Show only connection open/close packets to trace short-lived churning sessions
-
tcpdump -nn -i any host <ip> and not port 22Watch traffic to/from a host while dropping your own SSH session noise
-
tcpdump -nn -s 0 -X -i any port <port>Inspect full packet bodies in hex+ascii; -s 0 ensures no snaplen truncation
-
tcpdump -nn -i any -s 0 -C 100 -W 5 -w /tmp/cap.pcapRotate across 5 files of 100MB each so long captures never fill the disk
-
tcpdump -nn -i any -G 3600 -w '/tmp/cap-%Y%m%d-%H%M%S.pcap'Start a fresh pcap every hour with a timestamped name for unattended capture
-
tcpdump -nn -r /tmp/cap.pcap 'port 443 and host <ip>'Re-filter a saved capture without re-running it; BPF applies on read
-
tcpdump -nn -e -i any port 53Show DNS lookups with MAC addresses (-e) to map queries to clients on the LAN
no commands match — try a different search