I am connected from windows to linux using Putty. I have a file result.csv I want to copy all the text from this file to windows clipboard and then paste the text to a notepad? Please help me.


So my suggestion would be to copy the file to your local computer using scp instead. If you have ssh working then you should have the possibility to connect with scp.

Try using a program called winscp

  • Since the OP is using PuTTY, why do you recommend winscp instead of pscp or psftp? – Gilles Apr 2 '16 at 20:17
  • You are right any scp client will work. Personally if I don't have cygwin around I'm going with winscp to avoid the pain of using cmd. – morholt Apr 2 '16 at 20:29

On the Linux machine, logged into within PuTTY, cat result.csv. Within the PuTTY-window, hold shift and mark what you want to copy. That should be copied to Window's clipboard then.

  • 1
    PuTTY behaves unusually for Windows: anything you highlight by shift+drag (including autoscroll at top/bottom) or double or triple click (word or line) is immediately copied; conversely rightclick justs pastes and does not pop a menu. This method works as long as the data fits in scrollback memory, which you can adjust in the config dialog at Window (although if I try more than about 15million lines it thrashes and dies; using 0.64 on W8.1-64bit). – dave_thompson_085 Apr 3 '16 at 4:49

Nano is a terminal application, so it doesn't have cross-application copy-paste, only an internal clipboard.

It's possible to copy a file to the clipboard on a Linux machine, but that requires a GUI (an X server), you can't do that with a pure text connection. You can actually use PuTTY to make a text+graphics connection by activating X11 forwarding, but that requires additional software on the Windows side, because Windows doesn't support X11. If you want to do that, see How to use X11 forwarding with PuTTY or Installing/Configuring PuTTy and Xming or X11 Forwarding using Xming and PuTTY. Then you can use xsel -b <myfile.txt or xclip <myfile.txt to copy the content of myfile.txt to the clipboard.

Alternatively, you can use the PuTTY companion programs PSFTP and PSCP to copy files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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