36

I'm using PuTTY on Ubuntu 14.04 (Trusty Tahr) to connect to a serial port. I need to copy text from a PuTTY window to another window (for example, gedit).

UPDATE

I can copy by selecting text with the mouse and paste it by mouse middle click. But it does not work when I paste from another window.

UPDATE1

I haven't succeeded to fix this issue, but I've switched to the Ubuntu-native application GtkTerm which can copy-paste as usual from the Ubuntu terminal.

9 Answers 9

26

I've copied from the PuTTY manual:

PuTTY's copy and paste works entirely with the mouse. In order to copy text to the clipboard, you just click the left mouse button in the terminal window, and drag to select text. When you let go of the button, the text is automatically copied to the clipboard. You do not need to press Ctrl-C or Ctrl-Ins; in fact, if you do press Ctrl-C, PuTTY will send a Ctrl-C character down your session to the server where it will probably cause a process to be interrupted.

8
  • 7
    Thank you for quick reply but for me it does not work... I can copy by selecting(drag and drop) and paste by middle mouse click. But I cannot paste selected to another window.
    – fsquirrel
    Jul 30, 2015 at 12:51
  • This is weird. The copied content goes to Windows's clipboard, so it should be accessible to others as well.
    – Frantique
    Jul 30, 2015 at 12:56
  • 1
    Ohh, sorry, I missed the Ubuntu host part. :) Why do you use Putty and not a normal Terminal with SSH session?
    – Frantique
    Jul 30, 2015 at 13:01
  • 1
    As I'm connecting to device via UART. It is serial port connection not ssh.
    – fsquirrel
    Jul 30, 2015 at 13:12
  • 3
    @fsquirrel the solution is very simple, it's funny. Just don't CTRL + V to paste in the other application, use MIDDLE mouse button. Apr 18, 2019 at 23:44
12

COPY: Simply highlight text in PuTTY. Press and keep pressed left mouse button + move mouse to highlight the text you want + release left mouse button and text will be copied to the clipboard.

PASTE: Just click the middle mouse button to paste clipboard text in PuTTY itself or every other application that has a text prompt. Please note that modern mice don't have the middle 'button' but usually a wheel, so you have to click on the wheel. If you are using a laptop, tapping on the upper right corner of the touchpad (or on some models, pressing both buttons simultaneously) should reproduce a mouse middle click.

2
  • 1
    This work, but not for all applications, for example it is not possible to copy text directly in Firefox, in a text area of a web page. I need to copy to an opened text editor first. Apr 21, 2017 at 8:48
  • 1
    This answer almost resolved my confusion. Important detail: PuTTY's 'copy' is not to the clipboard. The normal clipboard will still be unmodified. This makes it seem like left button select did nothing. Left button select in PuTTY, then scroll button press in gedit to paste worked.
    – jws
    Jul 26, 2018 at 20:35
11

I found the solution here

Problem

Copy Paste text from PuTTY to Another Application on Ubuntu not working

solution

Select the text you want to copy on the screen and leave as it is. This will copy the text to PuTTY clipboard.

pasting to other application:

Go to the other application and press the middle button of the mouse. If your mouse only has two buttons, then press both left and right buttons simultaneously, it will paste the text on the other application. However, if you try to use CTRL + V , it will paste the content which is present in the default clipboard.

This worked for me on Fedora

3
  • 1
    This worked for my in Ubuntu.
    – Nick
    Aug 24, 2020 at 18:07
  • @Accountant Thanks for sharing tip. Would you check the web link and update? It looks like invalid at this moment.
    – Cloud Cho
    Mar 20, 2023 at 23:06
  • That's a life saver. Nov 1, 2023 at 21:12
5

I had same problem.
Despite suggestion from manual, left mouse button selection for copying text does not work for me.
I had found that middle mouse button does the trick.

2

Simple; just highlight the text in putty and right click. Note, though, that this will also paste the text into whatever you are working on in Putty.

For example, if you are copying text from Vim or Nano, highlight the text you want to copy, right click it, and then quit without saving.

1

You can use cat Abc.java to show the content of file. Then highlight the text and CTRL + C to copy the text.

After that, you can paste any where you want.

1
  • While your answer may be valid you could elaborate more about how and aswell format it a bit better, see Help Page
    – Videonauth
    Apr 21, 2016 at 14:12
1

There is an ugly way that I use to copy from Putty console. In Putty configuration window, I have enabled Session Logging to get the console output dumped to a file on my system.

My Putty Session Logging Configuration

Then I tail the log file in a local terminal with command:

tail -f <logFileName>

When I have to copy something, I go to the local terminal where the log is being tailed and copy what I need with CtrlShiftC.

1

just highlight the text on the terminal and click both right and left buttons on your touch pad simultaneously.

go to the text document and click the both buttons simultaneously for copying the details from terminal to text document.

this is what worked for me ..im on ubuntu 16.04 LTS

0

I have this same issue when working remotely using X, where I can't copy/paste from the remote putty window, which is displaying on my workstation, to local applications, e.g. copying a cisco configuration to a local text editor. My inelegant solution: remotely run gedit, paste into that, and then copy from gedit to the local host, which works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .