I'm trying to append the output of a command (stdout and stderr) to an existing file.
What I'm trying to do is something like this:
command >>file 2>>&1
The problem is that
2>>&1 throws an error, but
>>file 2>>file does not.
So, I think I'm misunderstanding how redirection works, or what is a file descriptor and what information is saved inside it.
Summarizing, what is the difference between the two following commands, and why the first one does not work, but the second one works?
command >>file 2>>&1 #not working command >>file 2>>file #working