How to Record and Replay Linux Terminal Sessions using ‘script’ and ‘scriptreplay’ Commands

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Computer Science student at Makerere University. Am a Linux enthusiast and a big fan of FOSS. I have used Linux for one year and six months now. I love to share ideas and knowledge around me and in other places around the world.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Linux BASH Programming Cookbook
Getting Started with Ubuntu 16.04
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

19 Responses

  1. sahil says:

    Hi Aaron,

    I’m unable to direct the timing information in a file.

    script --timing=filename.txt script.log
    script: invalid option — ‘-‘
    usage: script [-a] [-f] [-q] [-t] [file]

    Could you please help out.

  2. sahil says:

    Hi Aaron,

    I’m unable to get the time information directed to the time file.

    [ ~]#script –timing=filename.txt script.log
    script: invalid option — ‘-‘
    usage: script [-a] [-f] [-q] [-t] [file]
    #script –version
    script (util-linux-ng 2.17.2)

    Could you please help me out. I’m using centOS 6.

  3. SV says:

    Getting this error, any idea? It dies immediately.

    $ script
    Script started, file is typescript
    wsh: invalid option — ‘i’
    error=3 Invalid parameter
    usage: wsh [-d][ -c ][ -p ][ -s ]
    Sets login environment and spawns an interactive server.
    -d enable debugging
    -c set a single executed command
    -p set the configuration full path
    -s set the shell full path
    Script done, file is typescript

  4. Palani K says:

    How we can remove junk characters in ouput, No clear information in output.

  5. Keydon says:

    Are there specialized services or tools which convert those log and timing file to a gift similar to yours?

  6. foo bar says:

    how to install those commands on ubuntu ? -_-

  7. Dan Stromberg says:

    I wrote pypty, which is a pure-python reimplementation of script(1). It includes script-replay (note the dash), which allows you to step through your scripts with arrow keys (curses) or buttons (GObject Introspection).

  8. kunalsing says:

    When We are using –timing=time.txt It does not working It Does not show No such file or directory

    • Aaron Kili K says:

      @kunalsing You need to use the – -timing=filename.txt option with script first to create the timing information file, you can use any other name apart from time.txt, then use
      – -timing option with scriptreplay ie – -timing=filename.txt . The filename used with script must be the same as the one used with scriptreplay.

  9. Leon van Kammen says:

    I find these kind of tools very useful for tutorial purposes.
    Next to script there’s also ttyrec (available thru package manager on almost any distro).

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?