I'm generating an SSH key but I don't know how to copy the key from id_rsa.pub
to the clipboard. I'm using BackBox Linux.
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.
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.
To copy a file in a terminal, you use the cp command, which works exactly like the mv command, except that it duplicates the contents of a file rather than moving them from one location to another. As with the mv command, you can rename a file while copying it.
Open the file that you want to copy items from. Select the first item that you want to copy, and press CTRL+C. Continue copying items from the same or other files until you have collected all of the items that you want. The Office Clipboard can hold up to 24 items.
xclip -sel c < input_file
will copy the contents of input_file
to clipboard. xclip
requires installation. To install
sudo apt install xclip
-sel
stands for -selection
. c
is for clipboard
. Interchangeable.
Capable of much more, I advise reading its man page.
There is also xsel
. This answer on Unix SE gives a very thorough answer to this exact question.
xclip -selection clipboard -i < fileName
copies the content of file into clipboard
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