record the terminal session and replay later

May 11th, 2007 mysurface Posted in Misc, script, scriptreplay | Hits: 97743 | 19 Comments »

I have read this at linuxinsight, which is amazing. You can actually record down your typing, screen output even you are running ncurses cli, all the data will store into a file and the timing will be into another file. With this two files, you can have scriptreplay to replay it all with the correct timing.

Recording goes like this

script -t 2> tutorial.timing -a tutorial.session

type ‘exit’ to end the recording.

Replay goes like this

scriptreplay tutorial.timing tutorial.session

Both session and timing file is readable, if you do not need to be replay, just do

script -a tutorial.txt

You might be asking what have script did? logged your input as well as screen output? That means the password will be recorded as well when you do sudo? The answer is NO, script save only the things that is visible to you, not your keyboard hit. Same things goes to scriptreplay, it just play what ever is recorded, no real command executing during replay.

I found that generating and replay with two files (session and timing files) is a bit messy. Therefore I created a bash script to cater that, I name it as it will be creating only one file (it is just a dirty trick, read the bash script you will understand), replay and record uses is convenience.

To record,

./ -r

To play,

./ -p

Get and try it out. Remember to chmod +x after extract from the tar ball.

Oh ya, I included my output file here – matrix, download it and try to play with

./ -p matrix

Have Fun :)


19 Responses to “record the terminal session and replay later”

  1. Oh my gosh, that matrix typescript is freaking awesome cool!

  2. New software by enables window session recording and replaying. This is an enterprise scale solution that supports recording of thousands of window servers. All recording are searchable for any activity within them.

  3. […] There are many function with script see also – Record the terminal session and replay later […]

  4. although I know the tool script, but never know it can be so amazing. I have been search all the web until find your article.

  5. ultimate !!

  6. Also there is a site called PLAYTERM ( which replays your ‘script’ sessions online.

  7. […] the internet searching for exactly how to record a screencast of this nature, I ran across a blog post talking about how to play back terminal sessions using the output of the script program. This […]

  8. Check out It much easier than calling script by hand.

  9. hmmm true, script is a poorman’s ttyrec.
    I just found out supports ttyrec now.

  10. I have just created a gist for it.

  11. Any ideea how to call $exit within a shell script ?

  12. I’ll right away clutch your rss feed as I can’t in finding your email subscription hyperlink or e-newsletter service.
    Do you’ve any? Please permit me know so that I may just subscribe. Thanks.

  13. Please let me know if you’re looking for a article writer for your site. You have some really good articles and I feel I would be a good asset. If you ever want to take some of the load off, I’d
    really like to write some material for your blog in exchange
    for a link back to mine. Please blast me an email if interested.

  14. Hello colleagues, fastidious article and good urging commented here, I am
    genuinely enjoying by these.

  15. Excellent blog! Do you have any hints for aspiring writers?
    I’m hoping to start my own blog soon but I’m a little
    lost on everything. Would you advise starting with a free platform like WordPress or go for a
    paid option? There are so many options out there that I’m
    totally overwhelmed .. Any ideas? Thanks a lot!

  16. This is my first time pay a visit at here and i am actually
    happy to read everthing at single place.

  17. It’s really a great and useful piece of info.
    I’m happy that you simply shared this useful info with us.
    Please keep us informed like this. Thank you for sharing.

    homepage (Mozelle)

  18. I think this is among the so much vital information for me.
    And i am happy studying your article. But should
    commentary on some common things, The website taste is wonderful, the articles is really nice :
    D. Excellent activity, cheers

  19. What i do not realize is in truth how you’re now not really a lot more
    smartly-preferred than you may be now. You’re very intelligent.
    You know thus significantly when it comes to this subject, made me for my part consider
    it from a lot of numerous angles. Its like women and men don’t seem to be interested
    until it’s something to accomplish with Girl gaga!
    Your own stuffs great. At all times maintain it up!

Leave a Reply