Memory location of clipboard

I am looking for 2 answers.

  1. Where does ubuntu store its clipboard?

  2. How to view the clipboard text in terminal other than simply pasting?

1 Answer

Unfortunately, I don't know the answer to the first question (If someone knows, please edit this answer!). I do know the answer to the second.

You will need to install a utility called xclip.

Install xclip

sudo apt-get update
sudo apt-get install xclip

To view the clipboard:

xclip -o -sel p

or if nothing appears / error:

xclip -o -sel c

What these options mean:

xclip: the program
-o: Output to stdout (Standard Out, in this case, the terminal)
-sel: Select clipboard
-p: primary clipboard. Pretty much used for all copy/cut operations. (right-click, shortcut keys, etc.)
-s: secondary clipboard. Pretty much not used anymore. :)
-c: clipboard. Generally used for shortcut key copy/cut.

Which one should I care about?

The primary one. :)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like