5

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?

0

2 Answers 2

6

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
    
2
  • 5
    fos OS X use pbcopy instead of xclip
    – kobame
    May 10, 2013 at 19:50
  • 1
    Anyway 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
1

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.

2
  • 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

You must log in to answer this question.