Skip Navigation

How can i make the terminal continually print its output to a file?

A game i play, Terraria, tends to work fine for a while then freeze for anywhere from a few seconds to until i force my computer to restart. I'd like to know why it does this and how i can fix it. I figure a good start is running the game from the terminal and recording that terminal's output.

Just saving the output to a file manually isn't an option because when the problems start my computer is frozen. What i need is some way to make it write the output to a file as the program runs, and save that regularly so i still have most of it even if my computer crashes.

Is there something i can append to any command to do this, or maybe some other command that enables logging? I'm using MATE 22.2, if that helps.


Adding >>log.txt 2>>error.txt to the end of the command works. File names are arbitrary, but the error log is specified by 2>> instead of just >>. Thanks everyone.

7 comments
7 comments