Alex Rivera | Logout

Ubuntu> Clipboard copy, SSHK

Asked 2012-08-11T11:43:47.260
29

I have to copy the SSH Key for GitHub from id_rsa.pub. What is the clipboard utility that I could use, and what is the command line to copy to the clipboard. Done that, how to copy from the clipboard to a text file or anywhere. Please advice.

Edit
Report

1 Answer

38

If you are running the X Window System, you can use the xclip utility.

To install: sudo apt-get install xclip

To copy: xclip id_rsa.pub

To copy to clipboard: xclip -o | xclip -sel clip

To paste: xclip -o -sel clip > file.txt

Read the README file in the xclip source for more on how to use it.

answered 2012-08-11T12:21:23.003

Your Answer