2

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 1

2

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. :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .