- Standard input
- `#0`
- `stdin`
- Standard output
- `#1`
- `stdout`
- Standard error
- `#2`
- `stderr`
- Usually resolve to the user's current terminal
---
# Output
> "Redirect standard output (stdout) into a file, overwrite."
```txt
$ command > out-file
```
---
# Errors
> "Redirect standard error (stderr) into a file, overwrite."
```txt
$ command 2> err-out-file
```
---
# Output and errors
> "Redirect both, standard output (stdout) and standard error (stderr), into a file. Overwrite."
```txt
$ command &> out-n-err-file
```
---
# Input
> "Get the standard input (stdin) from a file.""
```txt
$ command < in-file
```
---
# Append and multiple redirections
> "Redirect both, append standard output (stdout) and standard error (stderr) into separate files."
```txt
$ command >> append-out-file 2>> append-err-file
```
---
# Piping
> "The standard output (stdout) of command1 will be the standard input (stdin) for command2."
```txt
$ command1 | command2
```
---
# Piping output and errors
> "Both standard output (stdout) and error (stderr) of command1 will be the standard input (stdin) for command2."
```txt
$ command1 2>&1 | command2
```
- bash supported version:
```txt
$ command1 |& command2
```