Is it possible to have a bash script put some text in the system clipboard?

(I use Ubuntu with default Gnome and Bash.)

link|improve this question

feedback

2 Answers

up vote 3 down vote accepted

There is a commandline tool xclip .
Example: Copy output of the following command to clipboard:

$ sort -n -k 3, -k 2 file.txt | xclip

Tutorial: http://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/

link|improve this answer
Accepted, for I could install it via my package manager. Thank you. – DerMike Dec 21 '11 at 14:20
feedback

I haven't tried it on my own, but there is a Bash Clipboard Interactive Script project on SourceForge: http://bics.sourceforge.net/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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