LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to redirect the command line output to the clipboard (https://www.linuxquestions.org/questions/linux-software-2/how-to-redirect-the-command-line-output-to-the-clipboard-701771/)

kejing 02-02-2009 07:57 PM

How to redirect the command line output to the clipboard
 
Sometimes, I would like to post some topics on the forum, and the contents of the topics come from the output the command line output.

Usually, I would run the command, and copy the output to the clipboard and then paste it here. I think it is a efficient less way to do the job and I am looking for if Bash has such kind of the feature.

David the H. 02-03-2009 12:21 AM

Use xsel or xclip.

For example, highlight some text and then run:

xsel -o | xsel -i -b

This will copy the contents of the highlight buffer straight to the clipboard. You can create an alias or button shortcut for it if you use it often.


All times are GMT -5. The time now is 02:28 AM.