

This should install the tcpdump utility and solve the "command not found" error. Note that if you're asked to install libcap, type in Yes or Y as it is a core dependency, without which tcpdump will refuse to start up. To install the tcpdump utility on Fedora, CentOS, and RHEL, issue the following command: sudo dnf install tcpdump On Arch-based systems, run: sudo pacman -S tcpdump On Debian/Ubuntu derivatives, run: sudo apt- get install tcpdump To install tcpdump, fire up the terminal and run the command corresponding to the Linux distro that you're currently using: In case you are unable to run the tcpdump command and are stuck at the " tcpdump: command not found" error, let's learn how to install tcpdump on your Linux machine. So you should be able to use it right away by typing in tcpdump with a sudo prefix. Now I think, you can play with the command as per your need.Tcpdump usually comes pre-installed with all mainstream Linux distributions and security-based alternatives. w mypcap.pcap will create that pcap file, which will be opened using wireshark. You can remove this to capture all packets. Port ftp or ssh is the filter, which will capture only ftp and ssh packets. Default is eth0, if you not use this option. i eth0 is using to give Ethernet interface, which you to capture. 65535, after this capture file will not truncate. s 0 will set the capture byte to its maximum i.e. You can use following command to capture the dump in a file: tcpdump -s 0 port ftp or ssh -i eth0 -w mycap.pcap I am writing this post, so that you can create a pcap file effectively. When you create a pcap file using tcpdump it will truncate your capture file to shorten it and you may not able to understand that. so many other options available, see tcpdump man page.you can directly see the capture of a remote system in any other Linux system using wireshark, for more detail click “ Remote packet capture using WireShark and tcpdump”.



you can also create a pcap file (to see the capture in wireshark),.you can see the packet dump in your terminal,.When you have only command line terminal access of your system, this tool is very helpful to sniff network packets. Tcpdump is a command line network sniffer, used to capture network packets.
