Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 2013 23:38:44 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Florent Peterschmitt <florent@peterschmitt.fr>
Cc:        freebsd-stable stable <freebsd-stable@freebsd.org>
Subject:   Re: tcpdump | grep pattern > capture   nothing got
Message-ID:  <966AFB1F-D273-4754-96AC-01298FBF6F42@FreeBSD.org>
In-Reply-To: <528D0302.7090906@peterschmitt.fr>
References:  <528D0302.7090906@peterschmitt.fr>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On 20 Nov 2013, at 19:44, Florent Peterschmitt <florent@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


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)

iEYEARECAAYFAlKNOf0ACgkQsF6jCi4glqNHLgCgsWLN3cdAo6+EOkd/x791kZgz
SZ0AoMWrGzH6pjILQBtBwrDYJpdQ1LiT
=lku9
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?966AFB1F-D273-4754-96AC-01298FBF6F42>