What does this Redirection do

Can anyone explain to me in layman terms what this does?

/usr/sbin/ping www.yahoo.com > /dev/null 2>&1

ping - sends a message to the ping server on the webserver www.yahoo.com and receives back a response message.

Normally the ping program displays output noting whether the message made it there and back and how long it took.

The ">/dev/null" is redirecting the normal output (standard output) to a device called "/dev/null" which basically means that the output is thrown away.

Instead of displaying on the screen, the output is not displayed and it is not saved anywhere.

The "2>&1" is causing the error output to go to the same place as "standard output". In this case, error output is also being thrown away.

So basically, this command is sending ping messages to www.yahoo.com but not displaying any output to report what it does.

See Also
Unix Administrator Career Path

Have a Unix Problem
Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.