CLI I/O Redirection

From FreekiWiki
Jump to navigation Jump to search

Introduction

The Command Line Interface (CLI) provides three types of input/output (I/O) flow.

  1. stdin = "Standard In;" input passed to a command
  2. stdout = "Standard Out;" output from a command
  3. stderr = "Standard Error;" error output from a command

This means that there are two types of output from any command stdout and stderr. It also means that you can separate them.

Commands

Abbreviations

stdio

<   = Send to

stdout

1>  = Redirect stdout, overwrite specified file
1>> = Redirect stdout, append specified file

stderr

2>  = Redirect stderr, overwrite specified file
2>> = Redirect stderr, append specified file

Examples

Quiz