I want to be able to run a command in my Terminal, and then quickly be able to copy the contents of the output into my clipboard without leaving my keyboard. Is there any way to do this?
2 Answers
No terminal emulator I know of let save the output from commands in the clipboard just using the keyboard.
An useful tool for the purpose could be xclip
. You can use it like this:
paste with middle mouse button:
$ some_command | xclip
paste with Ctrl-V
$ some_command | xclip -selection clipboard
-
5
-
1Anyway to do this after the command has already been run though? Not sure if that's important to the OP. May 12, 2013 at 4:24
See this question: https://stackoverflow.com/questions/14177700/copy-current-command-at-bash-prompt-to-clipboard
It explains how to use the bind command for copying the last command into the clipboard.
-
He doesn't want the command, he wants the contents of the output. May 12, 2013 at 4:22
-
The question seems to have been edited for a different purpose than what I originally tried to answer. May 13, 2013 at 4:35