When you redirect the output ls
to a file c
, this is a chicken and egg problem:
If c
it was not created in advance, this meant that the shell would need to save the output in a buffer and (at the end) write this buffer to a file.
Since in many cases this is not the best approach (due to memory management, failure management for commands that are interrupted before completion, etc.), the file is created in advance.
, , .