Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com May 13 '13 at 7:52

This question came from our site for professional and enthusiast programmers.

2 Answers 2

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
    
share|improve this answer
4  
fos OS X use pbcopy instead of xclip –  kobame May 10 '13 at 19:50
    
Anyway to do this after the command has already been run though? Not sure if that's important to the OP. –  Clayton Stanley May 12 '13 at 4:24

See this question: Copy current command at bash prompt to clipboard

It explains how to use the bind command for copying the last command into the clipboard.

share|improve this answer
    
He doesn't want the command, he wants the contents of the output. –  Clayton Stanley May 12 '13 at 4:22
    
The question seems to have been edited for a different purpose than what I originally tried to answer. –  Cameron Tinker May 13 '13 at 4:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.