Well... just copy and paste using the mouse buttons: select with the left-button, paste with the middle-button. Hmmm... maybe this is not the kind of answer you expected. More seriuosly, if you have a long code or a text file in general or a long output from a command, you can copy it using the xsel command.
xsel is an application that is not usually available in the default installation of Linux, but there should be a package available for Debian-based systems. Anyway the compilation from source is very straightforward. Once you have xsel installed you can "copy" the content of a file using
then use the middle mouse button to paste. You can also "copy" the very long output of a command using process substitution, for example
then paste in the usual way. Look for details about xsel on the developer's web page