howto copy all text in a gnome-terminal in RHEL linux 5.3

0

I work on the gnome-terminal in RHEL 5.3. Since the terminal does not have features like searching for text, etc, I usually want to copy the entire text in the terminal and paste into an editor.

In windows, with 5 key strokes, I can invoke the system menu and select "SELECT ALL" and then I can copy the selected text into clipboard.

What is an easy way to copy all the text to the clipboard in the gnome-terminal ?

Thank you,

anjanbacchu

Posted 2013-02-13T06:49:13.367

Reputation: 885

Other than clicking "Select All" in the menu? – Ignacio Vazquez-Abrams – 2013-02-13T06:55:58.293

@IgnacioVazquez-Abrams : I don't get the "Select all" menu option. Pls. remember that this is RHEL 5.3 (which was released in Jan 2009) – anjanbacchu – 2013-02-13T07:58:26.767

Why don't you use redirection to save the text you are interested in into a file? – terdon – 2013-02-13T12:33:22.917

@terdon : say I'm tailing the output of a program. In a ad hoc way, I might want to search for something. I might not know beforehand that I should have redirected the output to a file. When I know, I do that but there are lots of times I don't. In windows, I don't need to know in advance, the terminal makes life easier. – anjanbacchu – 2013-02-13T12:41:51.607

Answers

2

A not so easy way (because it involves you to learn to work with new software) is to use GNU Screen.

Inside screen use Ctrl+Esc to enter copy/scrollback mode. Once there you do have search capabilities with / and ? for vi like search and Ctrl+a+s and Ctrl+r for emacs like search.

Once you put the cursor in the place you want to start copying hit space and move the cursor, hit space again and it will copy the block. Open any editor and hit Ctrl+a+] to paste.

DavidG

Posted 2013-02-13T06:49:13.367

Reputation: 311

will try and get back with feedback – anjanbacchu – 2013-02-13T12:38:38.680

1

You have a couple of options.

  1. Go to the top of the text (mouse or Shift Home) and select all the text with the mouse, then copy it.
  2. When you open the terminal type script xxx, all the contents will be stored in a file xxx which you can search.

parkydr

Posted 2013-02-13T06:49:13.367

Reputation: 2 074

I have been using your option #1 -- it's way too cumbersome. I wanted something easier. your option #2 -- it seems better than option #1 -- the thing is I have several terminals(5-10) at any point of time and to remember which file to search is kinda going to be a pain. thanks all the same. – anjanbacchu – 2013-02-13T12:37:50.910