The script command records all your keystrokes and output into a file called typescript.

You can start recording by simply typing script.

<pre lang="bash">script
Script started, file is typescript
df -h
ls -l
exit

Typing exit stops the recording. Just cat typescript to see your recording.

<pre lang="bash">cat typescript