Create a Log File (script)

Use: Use the script command to create a log file of every command executed, and its output, during that terminal session.

To begin recording the log file use the following command:

eos$ script -f logfilename

The option -f is required for this course. It forces the script to start recording immediately.

To close the log file, type exit into the terminal window (this is true regardless of which options are used). For this course, DO NOT exit a log file until instructed.

Should I expect an output?

Yes:

Script started, file is logfilename

(after typing exit)
Script done, file is logfilename

NOTE:

The script command makes a typescript of terminal session, which just means it logs everything you type. This is useful when you have an error in your commands somewhere, and need to review the file (or for homework!).

You can also use something called scripting to automate repetitive tasks, which is not the same thing as the script command.