Where does ubuntu keep the content of clipboard? [duplicate]

Since they are "saved to clipboard", the contents must be stored somewhere.

Are they stored in a file?


Solution 1:

You seem to be lacking an understanding of clipboards in Linux. There are 3 usually available to users.

These clipboards are called "Selections"

There is:

  • PRIMARY - This is normally used for middle mouse button = copy/paste
  • SECONDARY - Normally not used by much, but it exists. Usually as an in app specific copy and paste.
  • CLIPBOARD - Usually Ctrl+c and Ctrl+v style copy and paste.

All of them are stored, by default in memory of the controlling application (usually Xorg, but not always). And every child application has access to it.

Clipboard monitors and managers exist that can monitor the clipboards and store their contents in a file, or more commonly, let you review your clipboard history.

Solution 2:

What clipboard? There are some apps/tools that can be used to store clipboard contents to a file on disk, but the core clipboard feature in X11 simply keeps what is in the clipboard, in memory. It is not stored in a file on disk.