Updated: 10 September 2022
Generate a key pair
ssh-keygen -t rsa
Copy key to clipboard
cat ~/.ssh/id_rsa.pub | xclip -sel clip
Freelance software engineer United Kingdom
Updated: 10 September 2022
Generate a key pair
ssh-keygen -t rsa
Copy key to clipboard
cat ~/.ssh/id_rsa.pub | xclip -sel clip
Updated: 07 May 2023
Pipe command to primary (middle mouse button) clipboard
cmd | xclip
Pipe command to ‘clipboard’ clipboard, for pasting into another application
cmd | xclip -sel clip
Copy contents of file to clipboard, for pasting into another application
xclip -sel clip file.txt
Updated: 04 February 2021
On Linux I like to make use of the select and paste feature i.e. selecting text copies it and the middle mouse button pastes it. When a laptop touchpad has no buttons a middle mouse click can be simulated with a three-finger tap, but this is awkward.
Here is my workaround (for keyboards with a numeric keypad only):
Furthermore, in a terminal and some other applications SHIFT + INSERT will paste text which has been previously selected.
I am using Ubuntu 20.04.1 and GNOME 3.36.8