LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-17-2012, 03:46 AM   #1
omega341991
Member
 
Registered: May 2012
Posts: 39

Rep: Reputation: Disabled
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
 
Old 05-17-2012, 05:03 AM   #2
rahulchandrak
Member
 
Registered: Apr 2010
Posts: 33

Rep: Reputation: 2
Hi omega341991,

execute command like this

tcpdump -X -nnvv -i wlan0 -c2 >filename.txt 2>&1
 
Old 05-17-2012, 05:12 AM   #3
omega341991
Member
 
Registered: May 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
thanks a lot , rahul
it works now
 
Old 05-17-2012, 05:38 AM   #4
omega341991
Member
 
Registered: May 2012
Posts: 39

Original Poster
Rep: Reputation: Disabled
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
 
Old 05-17-2012, 06:42 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Quote:
Originally Posted by omega341991 View Post
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
use tcpdump command . pswen Linux - Networking 1 08-27-2010 09:32 AM
tcpdump command vikasgupta Linux - General 1 12-10-2009 05:02 AM
command to compare or see flags and statistics of users lilmike Linux - Newbie 3 11-14-2009 12:13 AM
how to use tcpdump command jagdishpsp Linux - Newbie 4 10-16-2008 12:19 AM
tcpdump -w command doesn't write to file andykerouac Linux - Networking 2 03-03-2004 08:10 AM


All times are GMT -5. The time now is 02:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration