Often, you will want to save output of an entire SML/NJ session. How can you do this? Here's a few alternatives:
If you use the method described above for running SML/NJ under Emacs, you can save the *sml* buffer the same way you save any other buffer: switch to the buffer's window and hit C-x C-s. You will be prompted for a filename. You can save as many times as you wish.
In the X Window System, the idiom for "copy and paste" is to select a region, and then click the middle mouse button (the mouse wheel on an MS mouse suffices) at the spot you want to paste the selected region:
This method is only suitable if you want to run a single file through SML/NJ and capture the results, without actually interacting manually with SML/NJ. Invoke SML/NJ as follows:
sml < myinputfile.sml > myoutputfile.txt
The < sign means "redirect standard input from this file", and the > sign means "redirect standard output to this file". Pipes are a very important and powerful feature of Unix. Learn to use them!