diary

Records all commands and outputs of an interactive session to a file. If no arguments are passed, the diary state is toggled. To save outputs when running a script (non-interactive session), use outputlog.

Syntax

diary

diary on

diary off

diary filename

Inputs

on
Turns on the diary record, saving the data to a diary.txt file in the current directory.
Type: string
off
Turns off the diary record and closes the file.
Type: string
filename
Turns on the diary record, saving the data in the specified filename.
Type: string

Examples

Save diary to the default diary.txt file:
diary on
diary off
Save diary to a user-defined file:
diary mydiary.txt
diary off