How to print IP address using tcpdump and awk? -
i used command unable print multiple values before each '.
' command printing 192
of 192.168.113.2
. want print rest in same line.
sudo tcpdump -i 2 -c 20 -n | awk -f '>' '{print $2}' | awk -f ':' '{print $1}' | awk -f '.' '{print $1}'
please help.
sudo tcpdump -i 2 -c 20 -n | awk -f '>' '/>/{sub(".[^.]*:.*$", "", $2 ); print $2}'
Comments
Post a Comment