You can redirect the output stream and (or) errors to a file with overwriting it:1>file will output data from the output stream to a file with its creation or rewriting.2>file will output data from the error stream to the file with its creation or rewriting.1&>file (and several other options) will output data from both the output stream and the error stream to a file with its creation and rewriting.
You can output the output stream or the error stream to a file by writing at its end:
1>>file 2>>file But if you try to do something like 1&>>file , a syntax error will pop up.
How can I write to the end of the file from both the output stream and the error stream?