HOWTO+-+Record+console+using+script

script -a test.typescript -t 2> test.script



replay the file using: scriptreplay test.script