xclip is a command line interface for X11, based on the system of pipes. i nice and easy, works like a charm

to copy the full output of a directory in a the clipboard

$>ls -la | xclip

to copy the full content of a file

$>xclip /etc/shadow

to output the content

$>xclip -o

to output the content in a file

$xclip -o > ~/myfile