How to do ping really quiet?

Chris Cowart ccowart at rescomp.berkeley.edu
Wed Jan 7 12:56:26 PST 2009


KES wrote:
> Thx. This help, but seems ugly. Because of I can miss other maybe
> usefull errors ((
> ping -q ya.ru  2>/dev/null
> 
> Any other suggestions?

ping -q ya.ru 2>&1 1>/dev/null | grep -v 'ping: sendto: No route to host' >&2

Send ping stderr to stdout, throw away ping stdout, use grep to suppress
the error you don't care about, and optionally, write any other error
messages to stderr (mostly useful if this is wrapped up in some kind of
function that may or may not have its stdout redirected).

-- 
Chris Cowart
Network Technical Lead
Network & Infrastructure Services, RSSP-IT
UC Berkeley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090107/373d36ac/attachment.pgp


More information about the freebsd-questions mailing list