0

I have been looking for an answer to this and not finding anything which makes me think it's not possible but ...

Is it possible to save the current Gnome Terminal scrollback buffer to a file?

I know that I can do something like command > output.txt to redirect all output to a file, or command | tee output.txt to split the output to the terminal as well as to a file. What I am trying to do is capture this after the fact. I'd like to save the current terminal tab's scrollback contents to a file.

Robert
  • 67

1 Answers1

2

So you can do the following to save it in a file:

  • Highlight the text you want to be in the file by Edit->Select All

  • You can also highlight by following

    • triple-click the last line
    • press shift + home
    • shift + click the line you want to copy
    • Now just press cntrl+shift + c to copy.
  • You can then just save the copied text in a .txt file. You can also use xsel, just type the following in your terminal:

    sudo apt-get install xsel

Now type xsel -o > filename.txt

The filename.txt will be the name of the file, where you want the save the current Gnome Terminal scroll back buffer.

The newer version, i.e. GNOME 3.36.2 comes with a feature, copy as HTML which makes it possible to preserve any coloring and highlighting.