LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to store the statistics of a tcpdump command to a file (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-store-the-statistics-of-a-tcpdump-command-to-a-file-945454/)

omega341991 05-17-2012 02:46 AM

how to store the statistics of a tcpdump command to a file
 
the output of the tcp command is given below

/root/# tcpdump -X -nnvv -i wlan0 -c2 >filename.txt
tcpdump: WARNING: wlan0: no IPv4 address assigned
tcpdump: listening on wlan0, link-type IEEE802_11_RADIO (802.11 plus radiotap header), capture size 65535 bytes
13:10:22.588102 1.0 Mb/s 2412 MHz 11b -75dB signal antenna 1 0us Probe Request () [1.0 2.0 5.5 11.0 6.0 9.0 12.0 18.0 Mbit]
0x0000: 0000 0108 0204 0b16 0c12 1824 3204 3048 ...........$2.0H
0x0010: 606c 2d1a 3009 17ff ff00 0000 0000 0000 `l-.0...........
0x0020: 0000 0000 0000 0000 0000 0000 0000 ..............
13:10:22.682585 1.0 Mb/s 2412 MHz 11b -61dB signal antenna 1 336us Probe Request (mukund) [1.0* 2.0* 5.5* 11.0* Mbit]
0x0000: 0006 6d75 6b75 6e64 0104 8284 8b96 3208 ..mukund......2.
0x0010: 8c12 9824 b048 606c ...$.H`l
2 packets captured
2 packets received by filter
0 packets dropped by kernel


apart from the last 3 lines, all the rest are written to the file.
i want to write the last 3 lines also. so what shud i do?
pls reply

rahulchandrak 05-17-2012 04:03 AM

Hi omega341991,

execute command like this

tcpdump -X -nnvv -i wlan0 -c2 >filename.txt 2>&1

omega341991 05-17-2012 04:12 AM

thanks a lot :), rahul
it works now

omega341991 05-17-2012 04:38 AM

i would also like to know how to limit the duration of packet capture using tcpdump. For Eg.capturing data for 10 seconds using tcpdump

unSpawn 05-17-2012 05:42 AM

Quote:

Originally Posted by omega341991 (Post 4680696)
i would also like to know how to limit the duration of packet capture using tcpdump. For Eg.capturing data for 10 seconds using tcpdump

You already created a separate thread for your question here. Duplicating threads and posts is not efficient, not advisable and not appreciated so don't OK?


All times are GMT -5. The time now is 05:37 PM.