tcpdump Commands

Complete tcpdump commands reference — 63 commands across 1 categories. Quick reference cheat sheet for Linux, macOS & BSD.

Options (63)

ShortcutAction
tcpdump -APrint each packet (minus its link level header) in ASCII
tcpdump -bPrint the AS number in BGP packets using "asdot" rather than "asplain" representation, in RFC
tcpdump -B buffer_size --buffer-size=buffer_sizeSet the operating system capture buffer size to buffer_size, in units of KiB (1024 bytes)
tcpdump -c countExit after receiving or reading count packets
tcpdump --countPrint only on stdout the packet count when reading capture file(s) instead of parsing/prin
tcpdump -C file_sizeBefore writing a raw packet to a savefile, check whether the file is currently larger than
tcpdump -dDump the compiled packet-matching code in a human readable form to standard output and sto
tcpdump -ddDump packet-matching code as a C array of struct bpf_insn structures
tcpdump -dddDump packet-matching code as decimal numbers (preceded with a count)
tcpdump -D --list-interfacesPrint the list of the network interfaces available on the system and on which tcpdump can
tcpdump -ePrint the link-level header on each dump line
tcpdump -EUse spi@ipaddr algo:secret for decrypting IPsec ESP packets that are addressed to addr
tcpdump -fPrint `foreign' IPv4 addresses numerically rather than symbolically (this option is intend
tcpdump -F fileUse file as input for the filter expression
tcpdump -g --ip-onelineDo not insert a line break after the IP header in verbose mode
tcpdump -G rotate_secondsIf specified, rotates the dump file specified with the -w option every rotate_seconds seco
tcpdump -h --helpPrint the tcpdump and libpcap version strings, print a usage message, and exit
tcpdump --versionPrint the tcpdump and libpcap version strings and exit
tcpdump -i interface --interface=interfaceListen, report the list of link-layer types, report the list of time stamp types, or repor
tcpdump -I --monitor-modePut the interface in "monitor mode"; this is supported only on IEEE 802.11 Wi-Fi interface
tcpdump --immediate-modeCapture in "immediate mode"
tcpdump -j tstamp_type --time-stamp-type=tstamp_typeSet the time stamp type for the capture to tstamp_type
tcpdump -J --list-time-stamp-typesList the supported time stamp types for the interface and exit
tcpdump --time-stamp-precision=tstamp_precisionWhen capturing, set the time stamp precision for the capture to tstamp_precision
tcpdump --micro --nanoShorthands for --time-stamp-precision=micro or --time-stamp-precision=nano
tcpdump -K --dont-verify-checksumsDon't attempt to verify IP, TCP, or UDP checksums
tcpdump -lMake stdout line buffered
tcpdump -L --list-data-link-typesList the known data link types for the interface, in the specified mode, and exit
tcpdump --lengthsPrint the captured and original packet lengths
tcpdump -m moduleLoad SMI MIB module definitions from file module
tcpdump -M secretUse secret as a shared secret for validating the digests found in TCP segments with the TC
tcpdump -nDon't convert addresses (i.e., host addresses, port numbers, etc.) to names
tcpdump -NDon't print domain name qualification of host names
tcpdump -# --numberPrint a packet number at the beginning of the line
tcpdump -O --no-optimizeDo not run the packet-matching code optimizer
tcpdump -p --no-promiscuous-modeDon't put the interface into promiscuous mode
tcpdump --printPrint parsed packet output, even if the raw packets are being saved to a file with the -w
tcpdump --print-sampling=nthPrint every nth packet
tcpdump -Q direction --direction=directionChoose send/receive direction direction for which packets should be captured
tcpdump -qQuick output
tcpdump -r fileRead packets from file (which was created with the -w option or by other tools that write
tcpdump -S --absolute-tcp-sequence-numbersPrint absolute, rather than relative, TCP sequence numbers
tcpdump -s snaplen --snapshot-length=snaplenSnarf snaplen bytes of data from each packet rather than the default of 262144 bytes
tcpdump --skip countSkip count packets before writing or printing
tcpdump -T typeForce packets selected by "expression" to be interpreted the specified type
tcpdump -ttPrint the timestamp, as seconds since January 1, 1970, 00:00:00, UTC, and fractions of a s
tcpdump -tttPrint a delta (microsecond or nanosecond resolution depending on the --time-stamp-precisio
tcpdump -ttttPrint a timestamp, as hours, minutes, seconds, and fractions of a second since midnight, p
tcpdump -tttttPrint a delta (microsecond or nanosecond resolution depending on the --time-stamp-precision option)
tcpdump -U --packet-bufferedIf the -w option is not specified, or if it is specified but the --print flag is also spec
tcpdump -vWhen parsing and printing, produce (slightly more) verbose output
tcpdump -vvEven more verbose output
tcpdump -vvvEven more verbose output
tcpdump -V fileRead a list of filenames from file
tcpdump -w fileWrite the raw packets to file rather than parsing and printing them out
tcpdump -W filecountUsed in conjunction with the -C option, this will limit the number of files created
tcpdump -xWhen parsing and printing, in addition to printing the headers of each packet, print the d
tcpdump -xxWhen parsing and printing, in addition to printing the headers of each packet, print the d
tcpdump -XWhen parsing and printing, in addition to printing the headers of each packet, print the d
tcpdump -XXWhen parsing and printing, in addition to printing the headers of each packet, print the d
tcpdump -y datalinktype --linktype=datalinktypeSet the data link type to use while capturing packets (see -L) or just compiling and dumpi
tcpdump -z postrotate-commandUsed in conjunction with the -C or -G options, this will make tcpdump run " postrotate-com
tcpdump -Z user --relinquish-privileges=userIf tcpdump is running as root, after opening the capture device or input savefile, but bef
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Related Shortcut Pages

ss / netstat Nmap Wireshark Filters Nginx Docker Bash / Shell

Search 13,500+ shortcuts across 269 platforms

Explore All Platforms Practice Shortcuts
📜 Every shortcut on this page is taken from the official tcpdump documentation — man7.org
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

🤖 Ask AI about tcpdump shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok