File: //usr/share/wireshark/capinfos.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.16">
<title>capinfos(1)</title>
<link rel="stylesheet" href="./ws.css">
</head>
<body class="manpage">
<div id="header">
<h1>capinfos(1) Manual Page</h1>
<h2 id="_name">NAME</h2>
<div class="sectionbody">
<p>capinfos - Prints information about capture files</p>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="paragraph">
<p><span class="nowrap"><strong>capinfos</strong></span>
<span class="nowrap">[ <strong>-a</strong> ]</span>
<span class="nowrap">[ <strong>-A</strong> ]</span>
<span class="nowrap">[ <strong>-b</strong> ]</span>
<span class="nowrap">[ <strong>-B</strong> ]</span>
<span class="nowrap">[ <strong>-c</strong> ]</span>
<span class="nowrap">[ <strong>-C</strong> ]</span>
<span class="nowrap">[ <strong>-d</strong> ]</span>
<span class="nowrap">[ <strong>-D</strong> ]</span>
<span class="nowrap">[ <strong>-e</strong> ]</span>
<span class="nowrap">[ <strong>-E</strong> ]</span>
<span class="nowrap">[ <strong>-F</strong> ]</span>
<span class="nowrap">[ <strong>-h</strong> ]</span>
<span class="nowrap">[ <strong>-H</strong> ]</span>
<span class="nowrap">[ <strong>-i</strong> ]</span>
<span class="nowrap">[ <strong>-I</strong> ]</span>
<span class="nowrap">[ <strong>-k</strong> ]</span>
<span class="nowrap">[ <strong>-K</strong> ]</span>
<span class="nowrap">[ <strong>-l</strong> ]</span>
<span class="nowrap">[ <strong>-L</strong> ]</span>
<span class="nowrap">[ <strong>-m</strong> ]</span>
<span class="nowrap">[ <strong>-M</strong> ]</span>
<span class="nowrap">[ <strong>-n</strong> ]</span>
<span class="nowrap">[ <strong>-N</strong> ]</span>
<span class="nowrap">[ <strong>-o</strong> ]</span>
<span class="nowrap">[ <strong>-q</strong> ]</span>
<span class="nowrap">[ <strong>-Q</strong> ]</span>
<span class="nowrap">[ <strong>-r</strong> ]</span>
<span class="nowrap">[ <strong>-R</strong> ]</span>
<span class="nowrap">[ <strong>-s</strong> ]</span>
<span class="nowrap">[ <strong>-S</strong> ]</span>
<span class="nowrap">[ <strong>-t</strong> ]</span>
<span class="nowrap">[ <strong>-T</strong> ]</span>
<span class="nowrap">[ <strong>-u</strong> ]</span>
<span class="nowrap">[ <strong>-v</strong> ]</span>
<span class="nowrap">[ <strong>-x</strong> ]</span>
<span class="nowrap">[ <strong>-y</strong> ]</span>
<span class="nowrap">[ <strong>-z</strong> ]</span>
<span class="nowrap"><<em>infile</em>></span>
<span class="nowrap"><em>…​</em></span></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph">
<p><strong>Capinfos</strong> is a program that reads one or more capture files and
returns some or all available statistics (infos) of each <<em>infile</em>>
in one of two types of output formats: long or table.</p>
</div>
<div class="paragraph">
<p>The long output is suitable for a human to read. The table output
is useful for generating a report that can be easily imported into
a spreadsheet or database.</p>
</div>
<div class="paragraph">
<p>The user specifies what type of output (long or table) and which
statistics to display by specifying flags (options) that corresponding
to the report type and desired infos. If no options are specified,
<strong>Capinfos</strong> will report all statistics available in "long" format.</p>
</div>
<div class="paragraph">
<p>Options are processed from left to right order with later options
superseding or adding to earlier options.</p>
</div>
<div class="paragraph">
<p><strong>Capinfos</strong> is able to detect and read the same capture files that are
supported by <strong>Wireshark</strong>.
The input files don’t need a specific filename extension; the file
format and an optional gzip, zstd or lz4 compression will be automatically detected.
Near the beginning of the DESCRIPTION section of <a href="wireshark.html">wireshark</a>(1) or
<a href="https://www.wireshark.org/docs/man-pages/wireshark.html" class="bare">https://www.wireshark.org/docs/man-pages/wireshark.html</a>
is a detailed description of the way <strong>Wireshark</strong> handles this, which is
the same way <strong>Capinfos</strong> handles this.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_options">OPTIONS</h2>
<div class="sectionbody">
<div class="dlist">
<dl>
<dt class="hdlist1">-a</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the start time of the capture. <strong>Capinfos</strong> considers
the earliest timestamp seen to be the start time, so the
first packet in the capture is not necessarily the earliest -
if packets exist "out-of-order", time-wise, in the capture,
<strong>Capinfos</strong> detects this.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-A</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Generate all infos. By default <strong>Capinfos</strong> will display
all infos values for each input file, but enabling
any of the individual display infos options will
disable the generate all option.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-b</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Separate infos with ASCII SPACE (0x20) characters.
This option is only useful when generating a table
style report (-T). The various info values will be
separated (delimited) from one another with a single
ASCII SPACE character.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
Since some of the header labels as well as some
of the value fields contain SPACE characters. This
option is of limited value unless one of the quoting
options (-q or -Q) is also specified.
</td>
</tr>
</table>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-B</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Separate the infos with ASCII TAB characters.
This option is only useful when generating a table
style report (-T). The various info values will be
separated (delimited) from one another with a single
ASCII TAB character. The TAB character is the default
delimiter when -T style report is enabled.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-c</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the number of packets in the capture file.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-C</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Cancel processing any additional files if and
when <strong>Capinfos</strong> fails to open an input file
or gets an error reading an input file.
By default <strong>Capinfos</strong> will continue processing files
even if it gets an error opening or reading a file.</p>
</div>
<div class="paragraph">
<p>Note: An error message will be written to stderr
whenever <strong>Capinfos</strong> fails to open a file or gets
an error reading from a file regardless whether
the -C option is specified or not.
Upon exit, <strong>Capinfos</strong> will return an error status
if any errors occurred during processing.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-d</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the total length of all packets in the file, in
bytes. This counts the size of the packets as they appeared
in their original form, not as they appear in this file.
For example, if a packet was originally 1514 bytes and only
256 of those bytes were saved to the capture file (if packets
were captured with a snaplen or other slicing option),
<strong>Capinfos</strong> will consider the packet to have been 1514 bytes.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-D</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays a count of the number of decryption secrets in the file. This information
is not available in table format.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-e</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the end time of the capture. <strong>Capinfos</strong> considers
the latest timestamp seen to be the end time, so the
last packet in the capture is not necessarily the latest -
if packets exist "out-of-order", time-wise, in the capture,
<strong>Capinfos</strong> detects this.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-E</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the per-file encapsulation of the capture file.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-F</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays additional capture file information.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-h|--help</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Prints the help listing and exits.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-H</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the SHA256, RIPEMD160, and SHA1 hashes for the file.
SHA1 output may be removed in the future.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-i</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the average data rate, in bits/sec</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-I</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays detailed capture file interface information. This information
is not available in table format.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-k</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the capture comment. For pcapng files, this is the comment from the
section header block.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-K</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Use this option to suppress printing capture comments. By default capture
comments are enabled. Capture comments are relatively freeform and might
contain embedded new-line characters and/or other delimiting characters
making it harder for a human or machine to easily parse the <strong>Capinfos</strong> output.
Excluding capture comments can aid in post-processing of output.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-l</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Display the snaplen (if any) for a file.
snaplen (if available) is determined from the capture file header
and by looking for truncated records in the capture file.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-L</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Generate long report. <strong>Capinfos</strong> can generate two
different styles of reports. The "long" report is
the default style of output and is suitable for a
human to use.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-m</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Separate the infos with comma (,) characters. This option
is only useful when generating a table style report (-T).
The various info values will be separated (delimited)
from one another with a single comma "," character.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-M</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Print raw (machine readable) values in long reports.
By default <strong>Capinfos</strong> prints numeric values with human-readable SI
suffixes, and shows human-readable file type and encapsulation.
Table reports (-T) always print raw values.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-n</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays a count of the number of resolved IPv4 addresses and a count of
the number of resolved IPv6 addresses in the file. This information
is not available in table format.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-N</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Do not quote the infos. This option is only useful
when generating a table style report (-T). Excluding
any quoting characters around the various values and
using a TAB delimiter produces a very "clean" table
report that is easily parsed with CLI tools. By
default infos are <strong>NOT</strong> quoted.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-o</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays "True" if packets exist in strict chronological order
or "False" if one or more packets in the capture exists
"out-of-order" time-wise.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-q</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Quote infos with single quotes ('). This option is
only useful when generating a table style report (-T).
When this option is enabled, each value will be
encapsulated within a pair of single quote (')
characters. This option (when used with the -m
option) is useful for generating one type of CSV
style file report.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-Q</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Quote infos with double quotes ("). This option is
only useful when generating a table style report (-T).
When this option is enabled, each value will be
encapsulated within a pair of double quote (")
characters. This option (when used with the -m
option) is useful for generating the most common
type of CSV style file report.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-r</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Do not generate header record. This option is only
useful when generating a table style report (-T).
If this option is specified then <strong>no</strong> header record will be
generated within the table report.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-R</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Generate header record. This option is only useful
when generating a table style report (-T). A header
is generated by default. A header record (if generated)
is the first line of data reported and includes labels
for all the columns included within the table report.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-s</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the size of the file, in bytes. This reports
the size of the capture file itself.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-S</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Display the start and end times as seconds since January
1, 1970. Handy for synchronizing dumps using <strong>editcap -t</strong>.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-t</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the capture type of the capture file.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-T</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Generate a table report. A table report is a text file
that is suitable for importing into a spreadsheet or
database. <strong>Capinfos</strong> can build a tab delimited text file
(the default) or several variations on Comma-separated
values (CSV) files.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-u</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the capture duration, in seconds. This is the
difference in time between the earliest packet seen and
latest packet seen.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-v|--version</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the tool’s version and exits.</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-x</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the average packet rate, in packets/sec</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-y</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the average data rate, in bytes/sec</p>
</div>
</div>
</div>
</dd>
<dt class="hdlist1">-z</dt>
<dd>
<div class="openblock">
<div class="content">
<div class="paragraph">
<p>Displays the average packet size, in bytes</p>
</div>
</div>
</div>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_examples">EXAMPLES</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To see a description of the options use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos -h</pre>
</div>
</div>
<div class="paragraph">
<p>To generate a long form report for the capture file
mycapture.pcap use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos mycapture.pcap</pre>
</div>
</div>
<div class="paragraph">
<p>To generate a TAB delimited table form report for the capture
file mycapture.pcap use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos -T mycapture.pcap</pre>
</div>
</div>
<div class="paragraph">
<p>To generate a CSV style table form report for the capture
file mycapture.pcap use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos -T -m -Q mycapture.pcap</pre>
</div>
</div>
<div class="paragraph">
<p>or</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos -TmQ mycapture.pcap</pre>
</div>
</div>
<div class="paragraph">
<p>To generate a TAB delimited table style report with just the
filenames, capture type, capture encapsulation type and packet
count for all the pcap files in the current directory use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos -T -t -E -c *.pcap</pre>
</div>
</div>
<div class="paragraph">
<p>or</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos -TtEc *.pcap</pre>
</div>
</div>
<div class="paragraph">
<p>Note: The ability to use of filename globbing characters are
a feature of *nix style command shells.</p>
</div>
<div class="paragraph">
<p>To generate a CSV delimited table style report of all infos
for all pcap files in the current directory and write it to
a text file called mycaptures.csv use:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>capinfos -TmQ *.pcap >mycaptures.csv</pre>
</div>
</div>
<div class="paragraph">
<p>The resulting mycaptures.csv file can be easily imported
into spreadsheet applications.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://www.tcpdump.org/manpages/pcap.3pcap.html">pcap</a>(3), <a href="wireshark.html">wireshark</a>(1), <a href="mergecap.html">mergecap</a>(1), <a href="editcap.html">editcap</a>(1), <a href="tshark.html">tshark</a>(1),
<a href="dumpcap.html">dumpcap</a>(1), <a href="captype.html">captype</a>(1), <a href="https://www.tcpdump.org/manpages/pcap-filter.7.html">pcap-filter</a>(7) or <a href="https://www.tcpdump.org/manpages/tcpdump.1.html">tcpdump</a>(8)</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_notes">NOTES</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This is the manual page for <strong>Capinfos</strong> 3.6.2.
<strong>Capinfos</strong> is part of the <strong>Wireshark</strong> distribution.
The latest version of <strong>Wireshark</strong> can be found at <a href="https://www.wireshark.org" class="bare">https://www.wireshark.org</a>.</p>
</div>
<div class="paragraph">
<p>HTML versions of the Wireshark project man pages are available at
<a href="https://www.wireshark.org/docs/man-pages" class="bare">https://www.wireshark.org/docs/man-pages</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_authors">AUTHORS</h2>
<div class="sectionbody">
<div class="paragraph">
<div class="title">Original Author</div>
<p>Ian Schorr <ian[AT]ianschorr.com></p>
</div>
<div class="paragraph">
<div class="title">Contributors</div>
<p>Gerald Combs <gerald[AT]wireshark.org><br>
Jim Young <jyoung[AT]gsu.edu></p>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2022-03-04 16:13:20 UTC
</div>
</div>
</body>
</html>