Archive

Posts Tagged ‘stdout’

BASH Redirection

Quick reference

In BASH terminology, there are 3 file descriptors, stdin, stdout and stderr (std means standard).

Basically you can:

  1. redirect stdout to a file
  2. redirect stderr to a file
  3. redirect stdout to a stderr
  4. redirect stderr to a stdout
  5. redirect stderr and stdout to a file
  6. redirect stderr and stdout to stdout
  7. 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.

Read more…

  • Share/Bookmark
Categories: Linux Tags: , , , ,
This site uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.6.0.