From f4a196ab0e5210fe5574021b5182639c262b30f5 Mon Sep 17 00:00:00 2001 From: anthonyjvoss Date: Sun, 12 May 2019 11:39:12 -0500 Subject: [PATCH] Added stderr & stdout redirection examples (#28153) --- guide/english/bash/bash-redirection/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/guide/english/bash/bash-redirection/index.md b/guide/english/bash/bash-redirection/index.md index 534c2ae7a5..a62d055f1c 100644 --- a/guide/english/bash/bash-redirection/index.md +++ b/guide/english/bash/bash-redirection/index.md @@ -28,3 +28,18 @@ sort textfile.txt | uniq ``` will first sort each line in the file alpahabetically and then print only the unique entries. This is only scratching the surface of the massive power of pipes though. + +## Bash Redirect StdOut & StdErr +Another great use case is redirection of stdout(1) and stderr(2) streams. + +To simply hide the output, redirect the corresponding stream to null. The below example displays no stdout stream to the console. All stderr output will still be visible. + +somecommand 1>null + +The more common use is to hide any stderr output from the console. This example hides all stderr output. + +somecommand 2>null + +You can also hide all output using the '&' symbol. + +sommecommand &>null