Unable to get Grep get information in Terminal

106 Views Asked by At

I'm unable to get 'get' in terminal using Grep. This code used to work on Lion but in Maverick the GET doesn't show...

sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\:\ .*|GET\ \/.*"

Any help or suggestions maybe?

1

There are 1 best solutions below

2
On

Try:

sudo tcpdump -s 0 -A | egrep --color=never -a -o "Host\: .*|GET\ \/.*"

The -w - writes the raw packets whereas the -A decodes to ASCII; handy for web pages (per man)

I found that if grep was outputting color, the Host: lines were output as empty lines.