How to copy an output on a GNOME terminal to clipboard from command line.

I'd like to be able to paste text from my console textfiles smoothly to Firefox.

link|improve this question

12% accept rate
feedback

3 Answers

You can highlight the text then right click and select copy, or pipe it to xclip:

some-command | xclip

xclip may or may not be available depending on your distribution.

link|improve this answer
xsel is similar to xclip and can be used similarly. – alfplayer Dec 14 '09 at 23:19
feedback

You can also just mark the terminal output you want to copy and it is copied to your clipboard automatically.

link|improve this answer
Technically it's called the cut buffer, the clipboard is something else. – TRS-80 Jan 14 '10 at 2:55
feedback

After selecting the text, press Ctrl-Shift-C to copy it to the clipboard. The extra Shift is required as Ctrl-Cis already used in shells. Similarly, to paste, press Ctrl-Shift-V.

You can also just select it then middle-click in Firefox to paste it. This uses the cut buffer, which is slightly different to the clibpoard.

Bonus gnome-terminal tip - Ctrl-click a url to automatically open it in your default browser.

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.