• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ttyrec – Record Terminal Session in Linux

by admin

ttyrec is a tty(terminal) recorder in a Unix-like operating system & recorded data can be played back with the help of ttyplay command. ttyrec is just a derivative of script command for recording timing information with microsecond accuracy as well. It can record emacs -nw, vi, lynx, or any programs running on tty.

Installation on Ubuntu

Install the ttyrec package using:

$ sudo apt-get install ttyrec

Installation on CentOS/RHEL/Fedora

First Download the ttyrec rpm package using wget command and install using below mentioned yum command.

# wget ftp://ftp.pbone.net/mirror/ftp.turbolinux.com/pub/TurboLinux/stable/tested/Desktop/10/i586/ttyrec-1.0.6-1.i586.rpm
# yum localinstall ttyrec-1.0.6-1.i586.rpm

Now start Recording using ttyrec command:

Open the terminal type the below command and when you want to stop the recording type exit.

# ttyrec

When we run the above command recording of the terminal session will start and when you type exit, the recording will be stopped and a file name ‘ttyrecord’ will be created in the current directory.

Now Play the recorded session using ttyplay command:

# ttyplay ttyrecord

Commonly used options in ttyplay

Below are some commonly used options with ttyplay command:

  • -s SPEED: multiple the playing speed by SPEED (default is 1).
  • -n: no wait mode. Ignore the timing information in file.
  • -p: peek another person’s tty session.

We can also change the speed by using special keys like:

  • + or f: double the speed of playback.
  • – or s: halve the speed of playback.
  • 0: set playback speed to 0, pausing playback.
  • 1: set playback to speed 1.0 again.

Measuring the time of recorded data

Using ttytime command we can determine the time of recorded data in seconds.

#  ttytime ttyrecord
14  ttyrecord

Filed Under: CentOS/RHEL, Linux, Ubuntu

Some more articles you might also be interested in …

  1. filefrag: command not found
  2. How to use the ssh-keygen Command in Linux
  3. How to add swap space in linux
  4. mate-search-tool: command not found
  5. How to recover deleted Logical volume (LV) in LVM using vgcfgrestore
  6. grub2-mkpasswd-pbkdf2: command not found
  7. ebuild Command Examples in Linux
  8. etckeeper Command Examples in Linux
  9. How to Install GUI On CentOS/RHEL 8
  10. rkhunter Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • csslint: A linter for CSS code
  • csh: The shell (command interpreter) with C-like syntax (Command Examples)
  • csc: The Microsoft C# Compiler (Command Examples)
  • crystal: Tool for managing Crystal source code

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright