Using the script Command

 

Log in and issue the following command:

man script

in order to see what the script command does. Read what you see. (Press q to exit after reading.) You will use script to generate files to be turned in as assignments. During a session, from the time you issue the command until you press the ctrl-D key the system is looking over your shoulder and recording all screen activity into a file (named typescript by default). Try it. Issue the following, in the following sequence.

cd
script
date
ls

press ctrl-D key at this point

cat typescript

The last command will print the contents of the file named typescript onto the screen. You will recognize what you see, because it will be a copy of what you have just seen on the screen moments before, in the process of using the script command to generate the typescript file.