sudo ngrep -W byline -qilw 'get' tcp dst port 80 | grep -i ".*" |tee /tmp/output


sudo ngrep -W byline -qilw 'get' tcp dst port 80 | grep -i ".*" > /tmp/output

do not write anything to /tmp/output, when I do an http get request. Without redirection I can get some output on stdout. Why?

  • what is ngrep -W byline -qilw 'get' tcp dst port 80supposed to do ? – Archemar Nov 13 '16 at 17:45
  • capturing HTTP get request, linux.die.net/man/8/ngrep – rem Nov 13 '16 at 18:23
  • try removing -l (line buffering) option from ngrep – Archemar Nov 13 '16 at 18:31
  • @rem : I want to try a test. Try opening a shell as root using sudo -i first and then execute the command. See if it works or not. – 7_R3X Nov 13 '16 at 18:31
  • 1
    Perhaps it's just a matter of buffering then? have you tried adding --line-buffered to the grep (equivalent of ngrep -l ... )? – steeldriver Nov 14 '16 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.