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

--Apple-Mail=_A19706EC-9417-4AC2-9BA5-A901F8CCC40F
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

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.
>=20
> I was capturing with tcpdump and doing some grep on it:
>=20
> # tcpdump -li nfe0 port 53 | grep Refused > capture.txt
>=20
> 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


--Apple-Mail=_A19706EC-9417-4AC2-9BA5-A901F8CCC40F
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)

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

--Apple-Mail=_A19706EC-9417-4AC2-9BA5-A901F8CCC40F--



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