Save tcpdump to file and print to stdout

Today I found myself needing to save packets from tcpdump to a file but also view them on screen. I've wanted to do that in the past, but today it became more important. It was suggested to me to use two instances of tcpdump, but I thought there had to be a better way. Luckily there is.

# tcpdump -U -s 1500 -w - <bpf> |tee <file> | tcpdump -lnr -
Subscribe to Comments for "Save tcpdump to file and print to stdout" Subscribe to zmonkey.org - All comments