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.]
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.
The scrollback buffer is a function of your terminal or console.
If you are using the framebuffer console, it's possible to use the
fbcon=scrollback:
parameter at boot time to increase the size of the scrollback.For the xfce4-terminal, go to "Edit->Settings->General->Scrollback" and change the scroll-buffer to your likings.
for kde's konsole, go to "Settings->Configure current Profile...->Scrolling->Fixed number of lines"
the classical xterm can be configured with a startup-flag -sl 777 (for 777 lines of scroll-back buffer) or via the saveLines config.
For GNU screen, start it with screen -h .
I'd go with screen, in which you can search the scrollback buffer:
In scrollback mode (or copy mode, it is the same) you can also copy and paste text.