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.

Possible Duplicate:
Copy file to xclip and paste to Firefox

I would use the following command to copy the output of uptime to the clipboard:

uptime | xclip

Then I can paste the copied uptime to the console by clicking the middle button of mouse. But when I go to an application like "gedit", there is no Paste option available there. How can I copy a text into clipboard so that it could be pasted onto something like "gedit"?

share|improve this question

marked as duplicate by Gilles, Mat, jasonwryan, Michael Mrozek Jul 2 '12 at 7:18

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.

    
Does middle click not work in gedit? –  jw013 Jun 30 '12 at 14:24
    
@jw013 No it doesn't. –  Meysam Jun 30 '12 at 17:05

1 Answer 1

up vote 1 down vote accepted

I was having a similar issue until I did the following (on Ubuntu):

uptime | xclip -selection c

From the man pages:

-selection
             specify  which X selection to use, options are "primary" to
             use XA_PRIMARY (default), "secondary" for  XA_SECONDARY  or
             "clipboard" for XA_CLIPBOARD
share|improve this answer

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