Execution of a command in bash without saving it
Execution of a command in bash without saving it
February 7, 2023
What is Zero Bug Policy
What is Zero Bug Policy?
February 21, 2023

February 14, 2023

Different ways to save terminal outputs in Linux

In some situations, saving stdout and stderr of your terminal command output can be crucial, 
To automatically save stdout and stderr, there are several options you can go with


`>` : Write stdout outputs to file, stderr outputs to terminal.

$ command > output.txt

`2>` : Write stdout outputs to terminal, stderr outputs to file.

$ command 2> output.txt

`&>` : Both stdout and stderr outputs to file

$ command &> output.txt

`|& tee` : Both stdout and stderr outputs to file and terminal

$ command |& tee output.txt
Different ways to save terminal outputs in Linux
This website uses cookies to improve your experience. By using this website you agree to our Data Privacy Statement
Read more