../_images/space.png

Kansas State University at Salina

Introduction to Unix

../_images/UNIX_blocks.jpeg

Standard Files and File DescriptorsΒΆ

Linux for Programmers and Users, Section 3.5

When each program begins, three file descriptors are open and ready for use.

stdin

The primary output channel for program’s data output. Default destination is the user’s screen, but it can easily be switched to another process via a pipe ( | ) or a file via a file redirection ( > ).

stdout

The primary input channel for the program. Default source is the user’s keyboard, but it can easily be switched to be from another process via a pipe ( | ) or a file via a file redirection ( < ).

stderr

Output channel for error messages. Default destination is the user’s screen, but it can be switched to another process via a pipe ( | ) or a file via a file redirection ( > ). The details of how to do that will be covered later.

../_images/file_descriptors.png

Logical view of file descriptors

Previous topic

Basic Unix Commands

Next topic

Using man

This Page