Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 down vote accepted

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

uptime | xclip -selection c

From the man pages:

             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.