tcpdump command

Unix Command of the Day

This technical article is about tcpdump command in unix which is used extensively in linux and unix. tcpdump provides information about data that is received in machine and port.
Today’s Unix Command of the Day is tcpdump

tcpdump in unix

tcpdump in Unix is a very popular command

tcpdump – dump traffic on a network

tcpdump

Tcpdump prints out a description of the contents of packets on a network
interface that match the boolean expression. It can also be run with the -w
flag, which causes it to save the packet data to a file for later analysis,
and/or with the -r flag, which causes it to read from a saved packet file
rather than to read packets from a network interface. In all cases, only
packets that match expression will be processed by tcpdump.

Tcpdump will, if not run with the -c flag, continue capturing packets
until it is interrupted by a SIGINT signal (gener- ated, for example,
by typing your interrupt character, typically control-C) or a SIGTERM
signal (typically generated with the kill(1) command); if run with the -c
flag, it will capture packets until it is interrupted by a SIGINT or
SIGTERM sig- nal or the specified number of packets have been processed.

If you want to check for a particular port in a machine

then command is

tcpdump port

If you want to check for a particular ip in a machine
then command is

tcpdump host

Hope this linux command is useful for your programming. good luck

Like us in Google +