How to use TShark

Hackbydoing Academy tool guide · Traffic capture & analysis · free, no login

What TShark is, in plain words

Tshark is Wireshark in the terminal: it reads captured traffic and pulls it apart into labelled fields you can filter, print and count.

A working tshark command

tshark -r capture.pcap -Y http.request

This opens the saved capture capture.pcap and shows only the packets that are web (HTTP) requests.

Every piece of the command, explained

-TThe next piece names the shape of the printed output, most often fields, which prints just the fields you pick with -e, one line per packet — handy for scripts.
-VVerbose: print the full pulled-apart tree of details for each packet, every layer and field, instead of the one-line summary.
-YThe next piece is a display filter — a rule like http.request or dns that keeps only the packets matching it, chosen after the capture was made.
-eThe next piece is the name of one field to print, such as ip.src for the sender's address. Use it with -T fields, and repeat -e for each extra field.
-qQuiet: do not print the individual packets, which you want when -z is producing a summary so the packets do not bury it.
-rThe next piece is the name of a saved capture file to read and analyse, instead of capturing live.
-vPrint tshark's version number and related build details, then exit — a quick way to confirm the tool is installed and which release it is.
-zThe next piece names a set of statistics to calculate, such as io,phs, which counts packets by protocol (the protocol hierarchy) instead of listing them.

Use it the legal way

Only run tshark on systems you own or have explicit, written permission to test — at work that means a signed engagement, at home that means your own lab. Inside Hackbydoing Academy you practice on simulated networks and lab machines built for exactly this, where breaking things is the lesson and no one else's systems are involved. Learning how a tool works also teaches you what it looks like from the defender's chair: the logs it leaves, the traffic it makes, and the settings that shut it down.

✦ Practice TShark hands-on in a guided lab

Reading about tshark is step one. In the Academy you run it yourself, step by step, in guided labs on simulated networks — 185 rooms covering attack and defense, from your first scan to full operations, with a defender's debrief at the end of every room. Founding membership is $9.99/mo for the first 500 members.

Join Hackbydoing Academy →

Related tool guides

Free from the Hackbydoing Academy — learn cybersecurity by doing: real tools, guided labs, attack and defense, on simulated networks. More free material: Tool Guides index · Free Downloads Library · Hackbydoing Academy · Print this page (Ctrl/Cmd+P) for a clean paper copy.