20

In addition to this question: PuTTY how to select text and copy text using keyboard ONLY

I want to copy all text from file that I see in PuTTY to my Windows session. Something that in Windows would be done with Ctrl + A.

What is the equivalent in PuTTY?

Edit:

What I actually have is a long text file.
In Putty I can forward to the "next page" using Ctrl + V or simply going down with the arrow rows. The limit of row that I can see is with the height of my screen. If I could to see all of them I would simply mark them and copy them.. But I can't....

Think of it like a 400 pages long of word document you simply click Ctrl + A in the document and then you can copy it all. This is what I need in PuTTY.

avi
  • 333

3 Answers3

20

You can select all text in PuTTY by clicking the title bar icon and selecting "Copy all to clipboard":

putty select all

This will only copy the entire scrollback buffer. If your file is longer than the scrollback buffer, you will have to increase it. This can be done under "Window"->"Lines of scrollback".

putty scrollback

mtak
  • 17,262
6

Using an SSH terminal to copy file contents is not the best way. Use an SFTP client to download the file. Or even to edit it directly (if that's the ultimate goal).


Anyway, to answer your question:

  • In PuTTY, while you are connected, go to Change Settings > Windows > Control the scrollback in the window > Lines of scrollback and enter enough lines to fit your whole file.
  • Type cat filename on command prompt.
  • Use the Copy All to Clipboard command.

If there's anything in the "history" of the session already, clear it beforehand:

  • Press Ctrl+L to clear the visible screen.
  • Use the Clear Scrollback command.

You cannot copy a complete contents of a text-based editor, that you see in the PuTTY console.

  • For PuTTY the "screen" is a "black box". It does not know that there's more contents, than it sees.
  • And the remote editor does not have an access to the local clipboard.
3

enter image description here

Go to Logging -> do above settings.

Amruth A
  • 145