6

Basically I want to capture the process of installing a driver in Ubuntu so I can watch it later.

There are screen capture applications such as SimpleScreenRecorder, but they won't work in text mode because there is no display driver when I stop LightDM.

There is also fbcat which lets us take screenshots in textmode, but I wonder if there is something I can use to screencast when I switch to Ctrl+Alt+F2?

Zanna
  • 70,465
Hossein
  • 1,680

3 Answers3

5

Asciinema

If you want to go youtube style, look at asciinema. You can install it using:

sudo apt install asciinema

To get a more recent version if you are not on 18.04 yet, you can either use this ppa:

sudo apt-add-repository ppa:zanchey/asciinema
sudo apt update
sudo apt install asciinema

or use the pip method:

sudo apt install python3-pip
pip3 install asciinema --user

(see also: How to install pip (python) to user without root access)

Now start a recording session using

asciinema rec output.cast

which will drop you in another shell. Recording will last until you exit this shell. You can play the result using:

asciinema play output.cast

Beware! If you start asciinema rec without providing an output file name, it will default to uploading the recorded session to asciinema.org and returning just a URL. You can cancel before, but it's easy to miss that point.

Sebastian Stark
  • 6,122
  • 19
  • 48
  • 1
    wow! this was simple for me. works like a charm. – ptetteh227 Apr 12 '18 at 01:11
  • @SebastianStark: Thanks alot, I chose this over the ttyrec which by the way works prefectly fine just becasuse of the Sharing & embedding features Asciinema offers. that part was very neat. By the way I guess more people would enjoy this if you also add the pip installation method :) – Hossein Apr 12 '18 at 05:44
  • Note that this fails to pick up command error output generated in a virtual console. This can be inconvient if you're executing the command in the virtual console in order to see that output. – Tom Russell Jul 19 '21 at 17:11
3

You can use script to save everything printed or typed in the terminal.

From the script manpage:

DESCRIPTION

   script makes a typescript of everything displayed on your terminal.  It
   is useful for students who need a hardcopy  record  of  an  interactive
   session  as  proof  of  an  assignment.  

To use script:

script termout.txt

This will save all the screen contents to "termout.txt". Type exit to stop script

stumblebee
  • 3,547
1

ttyrec is a tty recorder. Recorded data can be played back with the included 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.
It is widely used for example in the NetHack community for storing game replays.

It is similar to the script command, but also allows for pausing, slowing down or speeding up playback. It can also stream the recording on the network and be used to transfer files with uudecode.

Usage
Recording

  % ttyrec
  (In the executed shell, do whatever you want and exit)

  % ttyrec -e command
  (command specified by -e option will be executed)

Playback

  % ttyplay ttyrecord

-s2 option makes the playback speed doubled. With -p option, you can peek another person's ttyrecord in real time. Have fun!

You can change the speed while playback by the following key strokes.

"+" or "f" to speed up the playback twice "-" or "s" to speed down the playback twice "1" to change the playback to the normal speed

Note:
You can end the recording by typing exit. and also you can specify a filename after ttyrec. if you don't specify one, it will create one.

Recorders/players
original ttyrec (Unix)
Term::TtyRec (Perl)
Term::TtyRec::Plus (Perl)
Tie::Handle::TtyRec (Perl)
termrec (Win32, Unix)

Playback only
TTYPLAYER (Java)
IPBT (Unix)

Hossein
  • 1,680