2

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?

Zanna
  • 69,223
  • 56
  • 216
  • 327
vico
  • 4,447
  • 20
  • 55
  • 87

1 Answers1

6

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
Byte Commander
  • 105,631
  • 46
  • 284
  • 425