First of all, this is not a question about history
, which stores all the entered commands.
I have on my workstation at work several open Terminals from which I launch simulations, examine the output and where occasionally error messages are displayed.
In Gnome Terminal
there is a setting controlling the length of the scroll back, in my case the setting is set to be just shy of 10000 lines.
Now my question: How can I search the scroll-back?
In my case I want to check whether a recent error message occurred previously.
Yes, I can scroll back and use my eyeballs to search for the error message in question.
But for several Terminals which are potentially up to 10000 lines long, that means a serious time spent scrolling.
I assume the information in the scroll-back needs to be stored somewhere, and if is stored somewhere it might actually be searchable.
[Edit: corrected the question to be about Gnome Terminal.]
Best Answer
If the output produced by your scripts is very important to you (to look for error, warning, actions that were run and so on), then you shouldn't rely on the display of the console you're using.
You have to redirect the output of your scripts to some files, this has advantages :
tee
.So, you can do this :
to copy all the output of script.sh to a file called output, appending the text to the end of the file and displaying the text on the terminal too.