script is a binary included in Ubuntu that can be used to record activity in a shell. It can optionally record timings too, to get exactly the same experience when replaying the recorded activity. …
script