From fbdb3dcbe0eca5f4b02f03ceecea6ba6c8ee6e93 Mon Sep 17 00:00:00 2001 From: Asocia Date: Sun, 29 Aug 2021 15:50:10 +0300 Subject: [PATCH] TIL: Redirecting the output of a command to a file --- .../redirecting-the-output-of-a-command-to-a-file.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 bash-scripting/redirecting-the-output-of-a-command-to-a-file.md diff --git a/bash-scripting/redirecting-the-output-of-a-command-to-a-file.md b/bash-scripting/redirecting-the-output-of-a-command-to-a-file.md new file mode 100644 index 0000000..a171020 --- /dev/null +++ b/bash-scripting/redirecting-the-output-of-a-command-to-a-file.md @@ -0,0 +1,8 @@ +1. Redirect stdout to one file and stderr to another file: + + command > out 2>error + +2. Redirect stdout to a file `out`, and then redirect stderr to stdout: + + command > out 2>&1 +