Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm coping file to xclip

cat file.txt | xclip

I'm pasting without problem with

xclip -o

When I want to paste it to Firefox with Ctrl+V it pastes old text (that shouldn't already be in the clipboard).

When I go back to terminal and run xclip -o it pastes the correct text.

Why is there a problem with pasting to Firefox?

share|improve this question
2  
Note that this is useless use of cat. You can also do xclip file.txt according to its man page, and in general you can also redirect input using <, e.g. $some_command < file.txt. –  janmoesen Oct 13 '11 at 18:33

1 Answer 1

up vote 10 down vote accepted

X11 has several available clipboards. By default, xclip places data in the primary selection buffer. To paste it, you use middle-click.

If you want to use Ctrl+v, use xclip -selection clipboard. See man xclip for more information.

There is good information about the different clipboards on freedesktop.org.

share|improve this answer
    
the command xclip -selection clipboard never ends and I don't have middle button (only touchpad) –  xralf Oct 12 '11 at 16:09
    
My fault, now I understand. –  xralf Oct 12 '11 at 16:12
1  
On a side note: I just noticed that xclip's option -f, -filter is a built in tee . It writes to the clipboard and to stdout at the same time. That could come in handy (for something). –  Peter.O Oct 13 '11 at 7:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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