LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 02: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, 02:20 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
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



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

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

All times are GMT -5. The time now is 09:21 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
Open Source Consulting | Domain Registration