Redirection
> outputFile, empty file
set -o noclobber, avoid to overwrite existing file
cat test > testFile, redirect output to a file
ls -al | more, pipe
>>, append text to existing file
IO stream number
- standard input: 0
- standard output: 1
- standard error: 2
- program-name 2> error.log, redirect program error to a file
- ls > dirlist 2>&1, redirect error to standard output
- make all 2> /dev/pts/0, redirect errors to standard output, suppose tty is /dev/pts/0