Wednesday, September 22, 2010

Linux STDIN STDERR

Linux STDIN STDERR

A single 2>&1 is in most cases senseless. It only says redirect output channel 2 to output channel 1.
Output channel 1 (aka STDOUT) is the normal way to output messages to the screen. Output channel 2 (aka STDERR) is the normal way to output errors to the screen.
Normally you will find a 2>&1 in conjunction with a > /dev/null. This will redirect normal messages (output channel 1) to the trash can /dev/null and error messages (output channel 2) to channel 1. So both normal and error messages will go into the virtual trash can /dev/null.


Have a nice day!

rsync with delete option and different ssh port

How to rsync e.g PIPELINE dir from Source to Destination? #rsync -avzr   --delete-before  -e "ssh -p $portNumber"  /local...