これはあなたが望むことを行うためのきちんとした方法です:
tcpdump -w - -U | tee somefile | tcpdump -r -
機能:
-w -tcpdumpに伝えますstdoutにバイナリデータを書き込む-Utcpdumpに伝えます パケットをバッファリングしてチャンクで出力するのではなく、受信時に各パケットを stdout に書き込むteeそのバイナリデータをファイルに書き込み、それ自身のstdoutに書き込みます-r -2 番目のtcpdumpを伝えますstdinからデータを取得する
tcpdump 4.9.3 以降 4.99.0、--print オプションを使用できます:
tcpdump -w somefile --print
Wednesday, December 30, 2020, by [email protected], denis and fxl.
Summary for 4.99.0 tcpdump release
[...]
User interface:
[...]
Add --print, to cause packet printing even with -w.