Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • I'm not sure I understand the question. When you use > any new output will overwrite the previous output as the filename is the same. >> will not overwrite but new output will always be added after the last line of the file; i.e. file is appended. Can you please clarify, maybe even with examples, what exactly it is you're after? Commented Feb 6, 2023 at 14:05
  • @Peregrino69 I added more detail. Commented Feb 6, 2023 at 14:21
  • ... and I again learned something new from @ilkkachu :-) Commented Feb 6, 2023 at 14:42
  • 3
    "Why and how does cmd >>out_err.txt 2>>out_err.txt work?" – Somewhat related: Is redirection with >> equivalent to > when target file doesn't yet exist? Commented Feb 6, 2023 at 20:32