The scriptreplay tool is a classic terminal utility included in the standard Linux utility suite that replays typescript recordings made with the script command, complete with original timing information. When attempting to review terminal training sessions or incident logs in stripped-down container images, minimal server builds, or cloud VMs, the shell returns bash: scriptreplay: command not found.
Install the util-linux Package via Distribution Repositories
The scriptreplay binary is distributed as part of the core util-linux suite:
- Ubuntu and Debian:
sudo apt update && sudo apt install -y bsdutils util-linux - Arch Linux:
sudo pacman -S util-linux - Fedora, CentOS Stream, and RHEL:
sudo dnf install -y util-linux - Alpine Linux:
sudo apk add util-linux
Verify PATH Resolution and Binary Location
In minimal environments, administrative binaries may reside in directories not registered in a standard non-root user PATH:
- Locate the binary location on disk:
whereis scriptreplay || find /usr -name scriptreplay 2>/dev/null - If located in
/usr/bin/scriptreplay, confirm executable permissions:ls -l /usr/bin/scriptreplay - Ensure
/usr/binis included in your active shell PATH environment variable:echo $PATH
Record and Replay a Terminal Session
Demonstrate proper usage using timing files and output typescripts:
- Initiate a recording with timing capture:
script --timing=timing.log output.log - Perform the terminal commands you wish to document, then type
exitto stop logging. - Replay the recorded session in real time:
scriptreplay --timing=timing.log output.log