Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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,

share|improve this question
    
Other than clicking "Select All" in the menu? –  Ignacio Vazquez-Abrams Feb 13 '13 at 6:55
    
@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 Feb 13 '13 at 7:58
    
Why don't you use redirection to save the text you are interested in into a file? –  terdon Feb 13 '13 at 12:33
    
@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 Feb 13 '13 at 12:41

2 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.

share|improve this answer
    
will try and get back with feedback –  anjanbacchu Feb 13 '13 at 12:38

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.
share|improve this answer
    
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 Feb 13 '13 at 12:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.