This question already has an answer here:

Trying to copy to clipboard from command line by using command:

xclip /etc/apt/sources.list

Trying to get out from clipboard:

xclip -o

This prints the content of sources.list and it is fine.

But now I try to paste into eclipse project and got some old clipboard content. Looks like xclip uses its internal clipboard.

How to copy into system clipboard from command line?

marked as duplicate by kos, Eric Carvalho, Pilot6, Ravan, Mark Kirby Dec 15 '15 at 9:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Try pasting using your middle mouse button into eclipse, after using the xclip /etc/apt/sources.list command – Charles Green Dec 9 '15 at 15:01

You need to specify the clipboard, instead of the default primary X selection:

xclip -o -selection clipboard

Or, if you use xsel instead, another tool with the same functionality, you just need the short option -b:

xsel -ob

Not the answer you're looking for? Browse other questions tagged or ask your own question.