Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu> Clipboard copy, SSHK [closed]

Tags:

ubuntu

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.

like image 881
Selvam Avatar asked Aug 11 '12 11:08

Selvam


People also ask

Why copy paste is not working in Ubuntu terminal?

Use Ctrl+Insert or Ctrl+Shift+C for copying and Shift+Insert or Ctrl+Shift+V for pasting text in the terminal in Ubuntu. Right click and selecting the copy/paste option from the context menu is also an option.

How do I clear the clipboard in Linux?

You can clear the X selection clipboard (the selection you can middle-click to paste) with xclip (install on Debian/Ubuntu-based systems with sudo apt install xclip ). You may need to first run export DISPLAY=:0 if you're running this from a different session, and that assumes you're running X11 on display zero.

How do I open clipboard in Ubuntu?

For Ubuntu with default GNOME desktop, open terminal either by searching from overview screen or by pressing Ctrl+Alt+T on keyboard. Other Linux, such as Fedora may install the clipboard manager via sudo dnf install gnome-shell-extension-gpaste command.

How do I enable copy and paste in Linux?

Press Ctrl + C to copy the text. Press Ctrl + Alt + T to open a Terminal window, if one is not already open. Right-click at the prompt and select “Paste” from the popup menu. The text you copied is pasted at the prompt.


1 Answers

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.

like image 106
duslabo Avatar answered Oct 06 '22 15:10

duslabo