Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I have copied something from Internet and I want that copied text to get copied to a file. But how can I copy that text without using mouse or any command like Ctrl+V. I want to do this from terminal. How can I do that in Ubuntu 12.04?

share|improve this question
Have a look at this – Null pointer May 22 '14 at 15:00

Using xclip.
For writing clipboard to file, overriding existing content:

xclip -o > /path/to/file.txt

or for appending clipboard to file:

xclip -o >> /path/to/file.txt
share|improve this answer
Good one. +1 from me. – Avinash Raj May 22 '14 at 15:32

Your Answer


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.