Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command Prompt - outputting results without overwriting target file

I have a situation where I output results from a CLI program:

e.g. input.exe > output.txt

Although output.txt already contains text, by default it gets overwritten when using the command above, how can you write the output to output.txt without overwriting existing data?

like image 522
Ken Avatar asked Feb 24 '23 03:02

Ken


1 Answers

Use the >> operator; it appends the output to the existing content of the file.

input.exe >> output.txt
like image 75
Matteo Italia Avatar answered May 15 '23 04:05

Matteo Italia