navthink
By:
navthink

How can I copy the text from the console?

September 22, 2014 7.8k views

Hi ^^
I was trying to copy the results of the following command:
cat ~/.ssh/id_rsa.pub

But I can't copy the results from the console.

How can I copy the text from the console?

Thank you
navthink,

5 Answers

If you can ssh to your server, you can use sftp to download the file.

Otherwise you may try to mail the file with mail command

sudo apt-get install mailutils
mail -s "My pub key" someone@domain.com < ~/.ssh/id_rsa.pub
  • thank you TonyTsang

    But what I wanted to know is to copy the text from the console of my drople.
    Isn't there any way to copy the text from the console of my drople?

    Thanks any way^^

    navthink

I use putty in Windows 8.1.. There, in Console Windows top title bar, one needs to right click.. That would open up the menu contain option "copy all"

Note, you dont need to select anything, copy all will copy everything.. Paste that into notepad and form there, take only what you need.

Thanks..

  • Thank you hunky^^

    I can't connect to my server via ssh client right now.

    Isn't there any way to copy the text from the console of my drople?

    Thanks any way^^

    navthink

Is there an answer to this? Would really appreciate it.

I'm actually needing to know the same thing. How can I copy the consoul log or at least get access to it? I can connect via ssh by the way.

  • Bring up the console in the browser developer tools.
  • In console tab, paste this snippet and hit ENTER
!function(){function t(){window.rfb.sendKey(e.shift().charCodeAt()),e.length>0&&setTimeout(t,10)}var e=prompt("Enter text to be sent to console").split("");t()}();
  • You’ll receive a dialog prompt to enter the copy to paste in.

Please note that you need to click on the VNC console and hit enter to execute the command.

  • This worked for me, but the @ character was replaced by a 2, and + by =. After I manually fixed those, it worked.

Have another answer? Share your knowledge.