It’s quite annoying when I know the command I can use to copy the content on a terminal to clipboard. I know, I can run
man xcip, but I think it’s still easier for me to visit this page and see how to do it.
For example, I want to copy the content of my ssh keypair, ed2559.pub, to clipboard, and here how it can be done:
➜ xclip -sel clip < ~/.ssh/id_ed25519.pub
➜ cat ~/.ssh/id_ed25519.pub | xclip -sel c
Here are what those options are:
-selection: specify which X selection to use, options are “primary” to use XA_PRIMARY (default), “secondary” for XA_SECONDARY or “clipboard” for XA_CLIPBOARD
clipboard: copy the selection to clipboard
xclip command has many other cool options, check
man xclip for more info.