tcpdump | grep pattern > capture nothing got

Florent Peterschmitt florent at peterschmitt.fr
Thu Nov 21 10:04:50 UTC 2013


On 21/11/13 09:08, Florent Peterschmitt wrote:
> On 20/11/13 23:38, Dimitry Andric wrote:
>> On 20 Nov 2013, at 19:44, Florent Peterschmitt <florent at peterschmitt.fr> wrote:
>>> I use FreeBSD 10.0-BETA3 amd64, upgraded from 9.2-RELEASE with
>>> freebsd-update.
>>>
>>> I was capturing with tcpdump and doing some grep on it:
>>>
>>> # tcpdump -li nfe0 port 53 | grep Refused > capture.txt
>>>
>>> I was surprised that capture.txt is totally empty. If I don't redirect
>>> the output, then it writes what I need on stdout.
>>
>> Try grep --line-buffered instead (which incurs a performance penalty,
>> but you probably don't care in this case).
>>
>> BSD grep also supports this option.
>>
>> -Dimitry
>>
> 
> It works, thank you. But, I didn't have to do this on a GNU/Linux
> machine. Is that normal?
> 

Woops my bad, it's the same on both FreeBSD and Linux.

-- 
Florent Peterschmitt           | Please:
florent at peterschmitt.fr        |  * Avoid HTML/RTF in E-mail.
+33 (0)6 64 33 97 92           |  * Send PDF for documents.
http://florent.peterschmitt.fr |  * Trim your quotations. Really.
Proudly powered by Open Source | Thank you :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20131121/eea942eb/attachment.sig>


More information about the freebsd-stable mailing list