Ubuntu – Long terminal output;time consuming code; no forethought

command lineoutput

I am running a rather complex python script in Ubuntu 12.10 for the last seven days. It must have generated atleast 20k lines of output on the terminal till now but not all of it is visible.

I didn't have the foresight to enable unlimited scrolling on the terminal neither did I try something like saving the output to some file. But now I am running out of time and I just can't think of rerunning the entire code again and try such options.

Does anyone know how can I see the complete output now without having to rerun the script?

Many Thanks

Best Answer

You can not. What goes outside the buffer is gone.


By the way... the smarter option would be to send that output to a logfile.

python script.py >/tmp/output.txt 2>&1

will send all output to /tmp/output.txt. If you open a 2nd TAB and do

tail -f /tmp/output.txt

you can see the log on screen and retain the information.


Also works:

python script.py | tee output.txt

or

python script.py 2>&1 | tee output.txt