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.
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With