1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-16 12:15:49 +02:00
tldr/pages/linux/tshark.md
bl-ue 8ebd171d6f
*: fix typos reported by Hunspell (#5848)
Co-authored-by: marchersimon <50295997+marchersimon@users.noreply.github.com>
Co-authored-by: Seth Falco <seth@falco.fun>
Co-authored-by: Patrice Denis <patricedenis@users.noreply.github.com>
2021-05-20 16:13:41 -04:00

35 lines
722 B
Markdown

# tshark
> Packet analysis tool, CLI version of Wireshark.
- Monitor everything on localhost:
`tshark`
- Only capture packets matching a specific capture filter:
`tshark -f '{{udp port 53}}'`
- Only show packets matching a specific output filter:
`tshark -Y '{{http.request.method == "GET"}}'`
- Decode a TCP port using a specific protocol (e.g. HTTP):
`tshark -d tcp.port=={{8888}},{{http}}`
- Specify the format of captured output:
`tshark -T {{json|text|ps|…}}`
- Select specific fields to output:
`tshark -T {{fields|ek|json|pdml}} -e {{http.request.method}} -e {{ip.src}}`
- Write captured packet to a file:
`tshark -w {{path/to/file}}`
- Analyze packets from a file:
`tshark -r {{filename}}.pcap`