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.4). You might think of typing script as pressing a Record button on a UNIX tape recorder.

Code Listing 15.4. Using script is a great way to keep records.
 [ejr@hobbes ch15]$ more covermybutt Script started on Fri Aug 28 14:30:16 1998 [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: 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.