Keeping a Record of Your Session with script

Occasionally, you may need to keep a record of a Unix session—for example, if you’re using Unix as part of a class assignment or need a session record to submit to your untrusting boss. You can do this using script, which keeps a record of every command you type from the shell prompt (Code Listing 15.7). You might think of typing script as pressing a Record button on a tape recorder.

Code Listing 15.7. Using script is a great way to keep records.
[ejr@hobbes ch15]$ more covermybutt
Script started on Fri Aug 28 14:30:16
2005
[ejr@hobbes ch15]$ pwd
/home/ejr/ch15
[ejr@hobbes ch15]$ who root tty1 Aug 28 14:18 ejr ttyp0 Aug 28 14:20 → (calvin.raycomm.com) ejr ttyp1 Aug 28 14:28 → (calvin.raycomm.com) ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.