LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-07-2012, 03:03 PM   #1
okorkie
Member
 
Registered: Mar 2007
Posts: 47

Rep: Reputation: 0
TCPDUMP help -- option question


Hello,

I have a question regarding TCPDUMP. I'm looking to run a TCPDUMP command with either of the following options:

- I want to capture x number of packets (somewhere between 1 to 10 packets)

or

- I want to capture for x number of seconds (I will want to capture for 1 second or less). Is it possible to capture for a time period of less than whole numbers (i.e. 0.5 seconds or 0.3 seconds, etc)?

Thanks in advance!
 
Old 02-07-2012, 03:20 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
You can always do something like this -- start a background process that sleeps for the desired time, then kill the dump.

Code:
tcpdump -A -i wlan0 &
pid=$?; sleep 3.25 && kill -9 $pid &
 
  


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
tcpdump question skoinga Linux - Networking 5 10-28-2010 02:32 PM
tcpdump -x option shows hex as well as ascii rooky Programming 2 11-25-2009 08:16 AM
tcpdump version 4.0.0 decode Agent-Information Option 82 robel Linux - Software 1 03-28-2009 12:40 PM
Tcpdump question? chinmays Linux - Software 9 01-08-2006 09:56 PM
tcpdump -n question Melissa22 Linux - Networking 3 03-07-2004 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:44 AM.

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