Use the options for output control of the pktcap-uw utility to save packet contents to a file, capture up to a certain number of bytes from each packet, and limit the number of captured packets.

The options of the pktcap-uw utility for output control are valid when you capture and trace packets. For information about the command syntax of the pktcap-uw utility, see pktcap-uw Command Syntax for Capturing Packets and pktcap-uw Command Syntax for Tracing Packets.

Options for Output Control That Are Supported by the pktcap-uw Utility



{-o | --outfile} pcap_file

Save captured or traced packets to a file in packet capture (PCAP) format. Use this option to examine packets in a visual analyzer tool such as Wireshark.

-P | --ng

Save packet content in the PCAPNG file format. Use this option together with the -o or --outfile option.


Print packet details and content to the console output. By default, the pktcap-uw utility shows packet information in the console output.

{-c | --count} number_of_packets

Capture the first number_of_packets packets.

{-s | --snaplen} snapshot_length

Capture only the first snapshot_length bytes from each packet. If traffic on the host is intensive, use this option to reduce the load on the CPU and storage.

To limit the size of captured contents, set a value greater than 24.

To capture the complete packet, set this option to 0.


View help about the pktcap-uw utility.

The vertical bars | represent alternative values, and the curly brackets {} used with vertical bars specify a list of choices for an argument or option.