Tshark Command-Line Cheat Sheet

Photo by Brett Sayles on Pexels
Published 14 April 2024 Last updated 15 April 2024 An older guide that hasn't been re-checked yet, so commands or versions may have moved on. How guides are made and checked

This Tshark cheat sheet is designed to briefly reference some of the most commonly used Tshark commands, along with a brief description and practical examples to illustrate their use. Whether you’re a seasoned professional looking to brush up on your command-line skills or a newcomer eager to explore the possibilities of networking through Tshark, you’ll find valuable insights and shortcuts here.

Installation:

DistributionCommand
Debian/Ubuntusudo apt install tshark
CentOS/Fedora/Red Hatsudo yum install tshark (CentOS/Fedora) sudo dnf install tshark (Fedora 22+)
NixOSnix-env -iA nixos.tshark

Tshark Cheat Sheet Commands:

TaskCommand
Capture packets on a specific interfacetshark -i eth0
Display filters while capturingtshark -i eth0 -Y 'http.request.method == "GET"'
Save captured packets to a filetshark -i eth0 -w /path/to/save/output.pcap
Read and analyze packets from a filetshark -r output.pcap
List all available capture interfacestshark -D
Decode packets as HTTPS on a specific porttshark -d tcp.port==443,http

Wrapping Up

This Tshark cheat sheet has highlighted the tool’s flexibility and power for everything from simple tasks to advanced operations. Mastering Tshark can significantly boost your networking skills. Keep practising, exploring further resources, and share your findings to deepen your understanding and contribute to the community’s collective knowledge.

You May Also Be Interested In

TShark Cheat Sheet References

Official Tshark Documentation (https://www.wireshark.org/docs/man-pages/tshark.html)