Skip to content

wireshark Linux command

Wireshark is a versatile command-line tool on Linux used for network analysis, capturing, and protocol decoding. It provides a comprehensive platform for monitoring and troubleshooting network traffic, allowing users to delve deep into packet inspection and analysis. With its robust set of features, Wireshark enables users to identify and resolve network issues effectively, making it an essential tool for network administrators and security professionals.

Terminal window
wireshark [options] [parameters]
OptionDescription
-kStart Wireshark without capturing packets
ParameterDescription
fileOpen a specific capture file
interfaceStart capturing on a specific interface
Terminal window
wireshark -i eth0

Captures packets on the interface “eth0”.

Terminal window
wireshark -r capture.pcap

Displays packets captured in the file “capture.pcap”.

Terminal window
wireshark -i wlan0 icmp

Captures packets on interface “wlan0” filtered by ICMP protocol.

Terminal window
wireshark -i eth0 -w capture.pcap

Saves captured packets from interface “eth0” to a file named “capture.pcap”.

Terminal window
sudo wireshark

Starts Wireshark with root privileges to capture packets on all interfaces.

Terminal window
wireshark -r capture.pcap -z conv,tcp

Displays TCP conversations from the captured file “capture.pcap”.

To use the wireshark command in Linux, execute the following command:

Terminal window
wireshark

How can I capture packets with wireshark in Linux?

Section titled “How can I capture packets with wireshark in Linux?”

To capture packets with wireshark in Linux, use the following command:

Terminal window
sudo wireshark -i <interface_name>

How do I display captured packets in wireshark on Linux?

Section titled “How do I display captured packets in wireshark on Linux?”

To display captured packets in wireshark on Linux, run the following command:

Terminal window
wireshark -r <file_name>

How can I apply display filters in wireshark on Linux?

Section titled “How can I apply display filters in wireshark on Linux?”

To apply display filters in wireshark on Linux, use the following command:

Terminal window
wireshark -k -f <display_filter>

How do I save captured packets as a file in wireshark on Linux?

Section titled “How do I save captured packets as a file in wireshark on Linux?”

To save captured packets as a file in wireshark on Linux, execute the following command:

Terminal window
wireshark -i <interface_name> -w <output_file>

How can I capture packets in promiscuous mode with wireshark on Linux?

Section titled “How can I capture packets in promiscuous mode with wireshark on Linux?”

To capture packets in promiscuous mode with wireshark on Linux, run the following command:

Terminal window
sudo wireshark -i <interface_name> -P

How do I capture packets for a specific duration with wireshark on Linux?

Section titled “How do I capture packets for a specific duration with wireshark on Linux?”

To capture packets for a specific duration with wireshark on Linux, use the following command:

Terminal window
sudo timeout <duration> wireshark -i <interface_name>

How can I view statistics of captured packets in wireshark on Linux?

Section titled “How can I view statistics of captured packets in wireshark on Linux?”

To view statistics of captured packets in wireshark on Linux, execute the following command:

Terminal window
wireshark -r <file_name> -z io,stat,1,"<display_filter>"
  • Capturing and analyzing network traffic
  • Troubleshooting network issues
  • Monitoring network activity
  • Analyzing network protocols
  • Identifying network security vulnerabilities