I wish to suppress all output to stdout (console) from hping3 from a bash script, but everything I try results in the statistics still being displayed, even tho the individual ping results are suppressed.
I've tried redirecting different ways, command line switch '-q' and nothing works.
Ideas?
hping3 10.1.1.1 -c 1 -q > \dev\null
hping3 10.1.1.1 -c 1 -q > logfile.txt
hping3 10.1.1.1 -c 1 -q 1>\dev\null
All result in the following to the console:
--- 10.1.1.1 hping statistic ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.1/1.1/1.1 ms
As @mark-wagner said, the correct syntax is
This redirects standard output to a bit-bucket file called
/dev/null
, and then redirects standard error to the same place.If this was insufficient (for example, output not on standard error or standard out) then you could do this:
This should work, no matter where the output is directed - I think.