OS Manuals

/usr/bin/tcpdump

A tool for network monitoring and data acquisition

From tcpdump 4.99.7-r2 (os), captured 2026-11-05 by running tcpdump --help (exit 0). permalink

tcpdump version 4.99.7
libpcap version 1.11.0 (64-bit time_t, with TPACKET_V3)
OpenSSL 4.0.3 29 Sep 2026
64-bit build, 64-bit time_t
Usage: tcpdump [-AbdDefghHIJKlLnNOpqStuUvxX#] [ -B size ] [ -c count ] [--count]
		[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]
		[ -i interface ] [ --immediate-mode ] [ -j tstamptype ]
		[ --list-remote-interfaces remote-source ]
		[ -M secret ] [ --number ] [ --print ] [ -Q in|out|inout ]
		[ -r file ] [ -s snaplen ] [ -T type ] [ --version ]
		[ -V file ] [ -w file ] [ -W filecount ] [ -y datalinktype ]
		[ --time-stamp-precision precision ] [ --micro ] [ --nano ]
		[ -z postrotate-command ] [ -Z user ] [ expression ]
Options (83)
OptionDescriptionSource
-APrint each packet (minus its link level header) in ASCII.man
-bPrint the AS number in BGP packets in ASDOT notation rather than ASPLAIN notation.man
-B buffer_sizeman
--buffer-size buffer_sizeSet the operating system capture buffer size to buffer_size, in units of KiB (1024 bytes).man
-c countExit after receiving count packets.man
--countPrint only on stdout the packet count when reading capture file(s) instead of parsing/printing the packets.man
-C file_sizeBefore writing a raw packet to a savefile, check whether the file is currently larger than file_size and, if so, close the current savefile and open a new one.man
-dDump the compiled packet-matching code in a human readable form to standard output and stop.man
-ddDump packet-matching code as a C program fragment.man
-dddDump packet-matching code as decimal numbers (preceded with a count).man
-Dman
--list-interfacesPrint the list of the network interfaces available on the system and on which tcpdump can capture packets.man
-ePrint the link-level header on each dump line.man
-EUse spi@ipaddr algo:secret for decrypting IPsec ESP packets that are addressed to addr and contain Security Parameter Index value spi.man
-fPrint foreign' IPv4 addresses numerically rather than symbolically (this option is intended to get around serious brain damage in Sun's NIS server — usually it hangs forever translating non-local…man
-F fileUse file as input for the filter expression.man
-gman
--ip-onelineDo not insert a line break after the IP header in verbose mode.man
-G rotate_secondsIf specified, rotates the dump file specified with the -w option every rotate_seconds seconds.man
-hman
--helpPrint the tcpdump and libpcap version strings, print a usage message, and exit.man
--versionPrint the tcpdump and libpcap version strings and exit.man
-HAttempt to detect 802.11s draft mesh headers.man
-i interfaceman
--interface interfaceListen, report the list of link-layer types, report the list of time stamp types, or report the results of compiling a filter expression on interface.man
-Iman
--monitor-modePut the interface in "monitor mode";man
--immediate-modeCapture in "immediate mode".man
-j tstamp_typeman
--time-stamp-type tstamp_typeSet the time stamp type for the capture to tstamp_type.man
-Jman
--list-time-stamp-typesList the supported time stamp types for the interface and exit.man
--time-stamp-precision tstamp_precisionWhen capturing, set the time stamp precision for the capture to tstamp_precision.man
--microman
--nanoShorthands for --time-stamp-precision=micro or --time-stamp-precision=nano, adjusting the time stamp precision accordingly.man
-Kman
--dont-verify-checksumsDon't attempt to verify IP, TCP, or UDP checksums.man
-lMake stdout line buffered.man
-Lman
--list-data-link-typesList the known data link types for the interface, in the specified mode, and exit.man
-m moduleLoad SMI MIB module definitions from file module.man
-M secretUse secret as a shared secret for validating the digests found in TCP segments with the TCP-MD5 option (RFC 2385), if present.man
-nDon't convert addresses (i.e., host addresses, port numbers, etc.) to names.man
-NDon't print domain name qualification of host names.man
-#man
--numberPrint a packet number at the beginning of the line.man
-Oman
--no-optimizeDo not run the packet-matching code optimizer.man
-pman
--no-promiscuous-modeDon't put the interface into promiscuous mode.man
--printPrint parsed packet output, even if the raw packets are being saved to a file with the -w flag.man
-Q directionman
--direction directionChoose send/receive direction direction for which packets should be captured.man
-qQuick (quiet?) output.man
-r fileRead packets from file (which was created with the -w option or by other tools that write pcap or pcapng files).man
-Sman
--absolute-tcp-sequence-numbersPrint absolute, rather than relative, TCP sequence numbers.man
-s snaplenman
--snapshot-length snaplenSnarf snaplen bytes of data from each packet rather than the default of 262144 bytes.man
-T typeForce packets selected by "expression" to be interpreted the specified type.man
-tDon't print a timestamp on each dump line.man
-ttPrint the timestamp, as seconds since January 1, 1970, 00:00:00, UTC, and fractions of a second since that time, on each dump line.man
-tttPrint a delta (microsecond or nanosecond resolution depending on the --time-stamp-precision option) between current and previous line on each dump line.man
-ttttPrint a timestamp, as hours, minutes, seconds, and fractions of a second since midnight, preceded by the date, on each dump line.man
-tttttPrint a delta (microsecond or nanosecond resolution depending on the --time-stamp-precision option) between current and first line on each dump line.man
-uPrint undecoded NFS handles.man
-Uman
--packet-bufferedIf the -w option is not specified, or if it is specified but the --print flag is also specified, make the printed packet output packet-buffered'';man
-vWhen parsing and printing, produce (slightly more) verbose output.man
-vvEven more verbose output.man
-vvvEven more verbose output.man
-V fileRead a list of filenames from file.man
-w fileWrite the raw packets to file rather than parsing and printing them out.man
-W filecountUsed in conjunction with the -C option, this will limit the number of files created to the specified number, and begin overwriting files from the beginning, thus creating a 'rotating' buffer.man
-xWhen parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header) in hex.man
-xxWhen parsing and printing, in addition to printing the headers of each packet, print the data of each packet, including its link level header, in hex.man
-XWhen parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header) in hex and ASCII.man
-XXWhen parsing and printing, in addition to printing the headers of each packet, print the data of each packet, including its link level header, in hex and ASCII.man
-y datalinktypeman
--linktype datalinktypeSet the data link type to use while capturing packets (see -L) or just compiling and dumping packet-matching code (see -d) to datalinktype.man
-z postrotate-commandUsed in conjunction with the -C or -G options, this will make tcpdump run " postrotate-command file " where file is the savefile being closed after each rotation.man
-Z userman
--relinquish-privileges userIf tcpdump is running as root, after opening the capture device or input savefile, but before opening any savefiles for output, change the user ID to user and the group ID to the primary group of…man
Examples (12) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.