29
If you are running the X Window System, you can use the xclip utility.
To install: sudo apt-get install xclip
To copy: xclip id_rsa.pub
To copy to clipboard: xclip -o | xclip -sel clip
To paste: xclip -o -sel clip > file.txt
Read the README file in the xclip source for more on how to use it.