How to capture console output to clipboard

Posted in Articles

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

Have you ever did a console command such as “ls” and it outputs a whole bunch of stuff to the screen that you want to copy and paste to a file. ┬áBut it scrolls through many screens.

A quick way on Windows is to pipe the output to “clip”…

$ ls | clip

see reference here.

For Mac, it would be …

$ ls | pbcopy

see reference here.