I run gnome-terminal with unlimited scroll-line history
I want to dump text I can see in terminal to file and parse it
Is there a way to do it?
If you want the whole contents of the terminal history:
In the gnome-terminal menu, Edit > Select All and then Edit > Copy. (Or use your favorite keyboard shortcut for the copy.)
Then paste anywhere.
If you want just part of the history, select with your mouse and then copy.
You could use the unix script command to capture things as you go.
If it's the output of a program that you want to capture and parse, simply redirect (>
) it into a file
program_with_lots_of_output > output.log
and then parse it. Append a 2>&1
to that if you want standard error as well.
If you want a screen capture (i.e. including input), use the script program.
You may want to use the 'tee' command. Tee bifurcates out stdout and makes a copy out the output in a file. So you can see the output and have the output stored also. Example:
ls | tee ls_out