Can you record what you are doing on terminal ?

script makes a typescript of everything that is printed on screen. If you want to record what you are doing on terminal, script is best option. It could be useful when you are experimenting something and you don’t want to note down anything but you need to know what commands you have used and what is output, etc. It is also useful for students when professor is taking some session and don’t want to take notes but can request for recorded file.

$ script
Script started, file is typescript

$ ls

Desktop Documents test typescript

$ cat test

This is text file.

$ exit

Script done, file is typescript
$

When you run script command, it will start recording what is getting printed on screen in file called "typescript" or one you have mentioned. Once you are done, you can end recording with exit or Ctrl-D. Now you can see what it has recorded.

$ cat typescript
Script started on Friday 07 February 2014 09:30:57 PM IST
$ ls
Desktop Documents test typescript
$ cat test

This is text file.

$ exit
Script done on Friday 07 February 2014 09:31:22 PM IST
$

It has recorded everything that has printed on screen after starting script. It also has added start and end time.

Note that if you have used commands which manipulate screen like vi will not be recorded correctly.

Enjoy!

Post a Comment

You must be logged in to post a comment.
%d bloggers like this: