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.
 - off
 - Turns off the diary record and closes the file.
 - filename
 - Turns on the diary record, saving the data in the specified filename.
 
Examples
diary on
diary offdiary mydiary.txt
diary off