Network
The tcpdump command
Captures the network traffic passing through an interface, to troubleshoot or study protocols.
Syntax
sudo tcpdump [-i interfaz] [-c N] [filtro]Most useful options
-iInterface to listen on-c NStops after capturing N packetsport 80Filters by portCopy-ready examples
$ sudo tcpdump -c 3Capture 3 packetsYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- Without -c it keeps capturing until you stop it with Ctrl+C.
FAQ
Do I need sudo?
Usually yes, because it accesses the network card directly.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course