Caution: This version of this document is no longer maintained. For the latest documentation, see


Create a typescript of a terminal session


script [-a] [file]

Runs on:



Append the output to file or to the typescript file, retaining the prior contents.
Name of the file script will use to save the session output. If you don't specify a file, output is saved in the file typescript.


The script utility records everything printed to the terminal during a session. This is useful, for example, if you want to record an interactive session and then save the typescript file for later analysis, tech support, etc.

The script ends when the forked shell exits (via Ctrl-D).

Note: Certain interactive utilities (e.g. vi) can create garbage in the typescript file. The script command works best with utilities that don't manipulate the screen; the results are meant to emulate a hardcopy terminal.

Note also that script records all transactions, including linefeeds and backspaces.

See also:

ksh (for the history feature)