Capturing a UNIX terminal session!

Capturing a UNIX terminal session!

One of the best methods to capture a Unix terminal session is to use the `script` command.

In this example we start a script session, run a couple of commands, and then use the `exit` command to stop capturing the terminal session:

$ script
Script started, output file is typescript
$ pwd
/home/will
$ ps
  PID  TT  STAT      TIME COMMAND
11909  p0  Ss     0:00.05 -bash (bash)
25622  p0  S+     0:00.01 script
25623  p1  Ss     0:00.01 /usr/local/bin/bash -i
25624  p1  R+     0:00.00 ps
$ exit
 
Script done, output file is typescript

We have now captured our terminal session into the file “typescript”.

We can use the `cat` command to view the contents of the “typescript” file:

$ cat typescript
Script started on Tue Jul 26 21:28:50 2005
$ pwd
/home/will
$ ps
  PID  TT  STAT      TIME COMMAND
11909  p0  Ss     0:00.05 -bash (bash)
25622  p0  S+     0:00.01 script
25623  p1  Ss     0:00.01 /usr/local/bin/bash -i
25624  p1  R+     0:00.00 ps
$ exit
 
Script done on Tue Jul 26 21:29:13 2005
 

If you’re new to UNIX, this concise book will tell you just what you need to get started and no more. This fifth edition is the most effective introduction to UNIX in print, covering Internet usage for email, file transfers, and web browsing. It’s an ideal primer for Mac and PC users who need to know a little about UNIX on the systems they visit. The new edition also contains many major and minor updates to help the reader navigate UNIX’s ever-expanding capabilities. In response to the popularity of Linux, the book now focuses on the popular bash shell preferred by most Linux users. A new chapter explains how to use ftp, pine for mail, and offers useful knowledge on how to surf the web. And the author has included tips throughout the text on security basics, especially in the Internet and networking sections. The book includes a completely updated quick reference card to make it easier for the reader to access the key functions of the command line.

Thanks & Regards

Ravi Bhure

Similar Posts:

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *