Tom Ordonez

Data Science, Machine Learning, Software Engineering

Redirect stdout and stderr in bash


This is how to redirect stdout and stderr in bash.

Redirect stdout and stderr in bash

Search for:

  • IO redirection in Linux
  • input redirection Linux
  • output redirection Linux
  • file descriptors bash

As seen here.

Redirect stdout to file "static."

1>static

Redirect and append stdout to file "static."

1>>static

Redirect stderr to file "static."

2>static

Redirect and append stderr to file "static."

2>>static

Redirect both stdout and stderr to file "static."

&>static

Redirect stderr to stdout.

2>&1

If you have questions or comments please add them below

Ask Question or Comment