Skip to content

Instantly share code, notes, and snippets.

@flashvnn
Created August 16, 2022 04:48
Show Gist options
  • Save flashvnn/4ef2ad7faaaf30afeeabfd4515ac89fa to your computer and use it in GitHub Desktop.
Save flashvnn/4ef2ad7faaaf30afeeabfd4515ac89fa to your computer and use it in GitHub Desktop.
Command redirect output to log file
|| visible in terminal || visible in file || existing
Syntax || StdOut | StdErr || StdOut | StdErr || file
==========++==========+==========++==========+==========++===========
> || no | yes || yes | no || overwrite
>> || no | yes || yes | no || append
|| | || | ||
2> || yes | no || no | yes || overwrite
2>> || yes | no || no | yes || append
|| | || | ||
&> || no | no || yes | yes || overwrite
&>> || no | no || yes | yes || append
|| | || | ||
| tee || yes | yes || yes | no || overwrite
| tee -a || yes | yes || yes | no || append
|| | || | ||
n.e. (*) || yes | yes || no | yes || overwrite
n.e. (*) || yes | yes || no | yes || append
|| | || | ||
|& tee || yes | yes || yes | yes || overwrite
|& tee -a || yes | yes || yes | yes || append
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment