In a Unix system, the two fundamental notion is that things are either a file or a process. A file is just a destination for or a source of a stream of data.
A process on the other hand is a program that is currently running and this program may be associated with a file that either stores the instructions that the program runs or a file that stores the output that the program generates. Files in a Unix system basically are a collection of data that can be referred to by name. Files can be created manually by users of the system or programmatically by running programs or processes.
- Stdin, Stdout and Stderror
- Stdin, Stdout and Stderror are default files in Unix with specific responsibilities.
- Stdin : Default sources of data. In the case of typing a command on the terminal, the default input is the keyboard.
- Stdout : Default destination for data. In the case of running a command on the terminal, the default output is the screen
- Stderr : Error messages can be redirected and sent to a file instead of being displayed on the screen. It can be sent to a specific filename or to a /dev/null device/destination. In the command shell, we can refere to these default sources / destinations using numbers.