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
Have a Unix Problem
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|