Use the script command. Press the CTRL-D keys when you wish to stop recording (scripting).
script <outputfile.ext>
mars-> script change.lis Script command is started. The file is change.lis.
ls -lrt
^D