How do I copy/paste log output from an SSH session

Asked by LEGOManiac on 2009-10-22

OK, Time for a stupid question....

I've connected to my server using an SSH session and listed a log file. Scrolling back through the log, I've identified the error messages that I want to print out. To print them, I need to have those lines on my local machine.

Stupidly, I figured it was just a case of highlighting those lines and copying/pasting them to a text file, yet this doesn't seem to work.

How do I copy/paste part of an SSH session into a local file, sort of copying the log file over to my local machine and editing it there?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Cristi Nistor
Solved:
2009-11-22
Last query:
2009-11-22
Last reply:
2009-10-24

This question was reopened

Ryan Dwyer (ryandwyer) said : #1

I take it you're using SSH through a terminal? You can just select the text, right click and choose Copy. Ctrl + C won't work.

Cristi Nistor (cristi-nistor) said : #2

Or in a terminal cu copy the output the keys combination is Ctrl + Shift + V and to paste in a terminal text the keys combination is Ctrl + Shift + C.

LEGOManiac (bzflaglegomaniac) said : #3

Actually, neither of those suggestions work.

To be more clear, I'm using PuTTY to connect to the server. If I highlight some text and right click, the end of the highlighted section moves to wherever the mouse was when I right-clicked.

CTRL-Insert (my preferred method though it's probably the same as Ctrl-C) does not put anything on the clipboard.

LEGOManiac (bzflaglegomaniac) said : #4

Actually, neither of those suggestions work.

To be more clear, I'm using PuTTY to connect to the server. If I highlight some text and right click, the end of the highlighted section moves to wherever the mouse was when I right-clicked.

CTRL-Insert (my preferred method though it's probably the same as Ctrl-C) does not put anything on the clipboard.

Cristi Nistor (cristi-nistor) said : #5

http://the.earth.li/~sgtatham/putty/0.52/htmldoc/Chapter3.html#3.1.1

it seems that you have to use the left mouse button to highlight the text. It will be automatically copied to Clipboard when you release the button.

LEGOManiac (bzflaglegomaniac) said : #6

Nope. That's not working either. On the hunch that maybe you meant the right mouse button, I tried that too and still no joy. There's no response at all to the middle mouse button.

Thanks for the reference to the Putty manual, but I think it's intended for Windows. Aside from making specific references to the Windows clipboard, some of the Putty behaviors are different. They describe, for example, highlighting a rectangular section of text by holding down the Alt key while dragging the mouse. On my system this drags the Putty window which I believe is the default behavour for the ALT key in Xorg.

I suppose there are three posiblities:

- either Putty just can't do this - which I doubut
- or I just need to learn the technique specific to Linux
- or my system is misconfigured somehow such that the default behaviors are no longer working and I need to reset them.

Cristi Nistor (cristi-nistor) said : #7

Is your mouse emulated for 3 buttons? Also I found this on ubuntuforums.org maybe it helps :):

http://ubuntuforums.org/showthread.php?t=107159

Good luck.

LEGOManiac (bzflaglegomaniac) said : #8

Thanks for the link. I had seen that thread when I was initially researching this problem. It was never resolved for that user either.

For what it's worth, I can use the mouse to highlight and copy or paste in windows on my local machine so I've not had any reason to suspect a problem with the mouse.

LEGOManiac (bzflaglegomaniac) said : #9

Are there any other decent SSH clients other than PuTTY?

Best Cristi Nistor (cristi-nistor) said : #10

http://gftp.seul.org/ I don;t use it as a SSH client (only FTP) but you can connect using ssh://. You should take a look at http://gftp.seul.org/. Another option is OpenSSH https://help.ubuntu.com/9.04/serverguide/C/openssh-server.html (main site http://www.openssh.org/).

Putty is more for Windows and less for Linux.

Good luck

LEGOManiac (bzflaglegomaniac) said : #11

Thanks Cristi Nistor, that solved my question.