Last Updated : 28 Apr, 2025
scriptreplay command is used to replay a typescript/terminal_activity stored in the log file that was recorded by the script command. With the help of timing information, the log files are played and the outputs are generated in the terminal with the same speed the original script was recorded.
The replay does not run the command again but it only displays the same information once again, thus scriptreplay must be run on the same type of terminal the typescript was recorded to work properly. By default, the replay displays the information stored in a typescript file if no other filename is specified.
Syntaxscriptreplay [-t] timingfile [typescript] [divisor]
where,
The script
command records terminal sessions and than replay it
First, use script
to record your terminal activity. For example:
script -t 2>time_log -a geeksforgeeks_session
-t 2>time_log
: Saves timing data to time_log
.-a geeksforgeeks_session
: Saves the terminal output to geeksforgeeks_session
.Play it back with:
scriptreplay -t time_log geeksforgeeks_sessionBasic Example
To replay a recorded script with script filename as geeksforgeeks and timing output file as time_log.
Key Options used with the scriptreplay command 1. -t, --timing:This option is used for script timing output file.
Example: To replay the script timing file, time_log.
scriptreplay -s geeksforgeeks -t time_log2. -s, --typescript:
This option is used for script terminal session output file.
Example: To replay the script namely geeksforgeeks using -s option.
scriptreplay -s geeksforgeeks --timing=time_log3. -d, --divisor:
This option is used when we want to speed up or slow down execution with time divisor. The argument here is a floating point number.
Example 1: To replay the script, geeksforgeeks with 2x speed we will use 2 as a divisor.
Input:
scriptreplay -s geeksforgeeks --timing=time_log 2
The replay speed will increase by twice.
Output:
Example 2: To replay the script, geeksforgeeks with 2 times slower we will use 0.2 as a divisor.
4. -V, --version:Output version information and exit.
5. -h, --help:Display this help and exit.
scriptreplay --helpConclusion
The scriptreplay command is a valuable tool for anyone who needs to recreate terminal sessions exactly as they occurred. scriptreplay ensures that you can accurately replay and analyze terminal behavior by using options like timing adjustments and divisors, having full control over how the playback is displayed, making it adaptable to various scenarios.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4