BASH Redirection
January 20th, 2010
No comments
Quick reference
In BASH terminology, there are 3 file descriptors, stdin, stdout and stderr (std means standard).
Basically you can:
- redirect stdout to a file
- redirect stderr to a file
- redirect stdout to a stderr
- redirect stderr to a stdout
- redirect stderr and stdout to a file
- redirect stderr and stdout to stdout
- redirect stderr and stdout to stderr
Next, 1 represents stdout and 2 means stderr.
A little note for seeing this things: with the less command you can view both stdout (which will remain on the buffer) and the stderr that will be printed on the screen, but erased as you try to ‘browse’ the buffer.



Recent Comments