A blog by Devendra Tewari
On Ubuntu, install the xclip package.
xclip
Pipe output to xclip -selection clipboard
xclip -selection clipboard
ls | xclip -selection clipboard