Epoxsea Software Document Help

Stream Redirection and Piping

\#linux

Stream Flow

Standard Input/STDIN

Standard Output/STDOUT

Standard Error/STDERR

File

Command

File/Device

File/Device

Stream

#

Stream Name

Stream Full Name

Description

0

STDIN

Standard Input

Data input into the program

1

STDOUT

Standard Output

Data output from the program

2

STDERR

Standard Error

Error messages (Default is the terminal)

STDIN, STDOUT and STDERR Redirect Operator

Operator

Description

Example

<

Redirect STDIN from file

<command> < <file>

---

>

Redirect STDOUT overwriting file

<command> > <file>

>>

Redirect STDOUT appending file

<command> >> <file>

1>&2 or >&2

Take the STDOUT, redirects it to STDERR

<command> > <file> >&2

---

2>

Redirect STDERR overwriting file

<command> 2> <file>

2>>

Redirect STDERR appending file

<command> 2>> <file>

2>&1

Take the STDERR, redirects it to STDOUT

<command> > <file> 2>&1

---

&>

Redirect STDOUT and STDERR overwriting file

<command> &> <file>

&>>

Redirect STDOUT and STDERR appending file

<command> &>> <file>

Other Operator

Operator

Name

Description

Example

;

Sequential Lists

Run two command in one line

<command1>; <command2>

&

Background Lists

Run as background

<command1>& <command2>

\|

Command Line Pipes

Take the STDOUT of LHS, puts it into STDIN of RHS

<command1> \| <command2>

&&

AND Lists

Only LHS command run successfully, RHS will run

<command1> && <command2>

\|\|

OR Lists

Only LHS command run unsuccessfully, RHS will run

<command1> \|\| <command2>

Remark:

  • In the context of the bash shell, a list is series of commands separated by one or more of these operators

Last modified: 12 June 2025