Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Using Handy Utilities > Keeping a Record of Your Session with scrip...

Keeping a Record of Your Session with script

Occasionally, you may need to keep a record of a Unix session—for example, if you’re using Unix as part of a class assignment or need a session record to submit to your untrusting boss. You can do this using script, which keeps a record of every command you type from the shell prompt (Code Listing 14.6). You might think of typing script as pressing a Record button on a tape recorder.

Code Listing 14.6. Using script is a great way to keep records.

[ejr@hobbes ch14]$ more covermybutt
Script started on Fri May 15 14:30:16 2009
[ejr@hobbes ch14]$ pwd
/home/ejr/ch14
[ejr@hobbes ch14]$ who
root    tty1     May 15 14:18
ejr     ttyp0    May 15 14:20 (calvin.raycomm.com)
ejr     ttyp1    May 15 14:28 (calvin.raycomm.com)
[ejr@hobbes ch14]$ ps ax
  PID TTY STAT TIME COMMAND
    1  ?  S   0:02 init [3]
    2  ?  SW  0:00 (kflushd)
    3  ?  SW< 0:00 (kswapd)
   48  ?  S   0:00 /sbin/kerneld
  229  ?  S   0:00 syslogd
  238  ?  S   0:00 klogd
  260  ?  S   0:00 crond
  272  ?  S   0:00 inetd
  283  ?  S   0:00 lpd
  298  ?  S   0:00 sendmail: accepting
connections on port 25
  310  ?  S   0:00 gpm -t ms
  321  ?  S   0:00 httpd
  355  ?  S   0:00 nmbd -D
  368   1 S   0:00 /bin/login - root
  369   2 S   0:00 /sbin/mingetty tty2
  370   3 S   0:00 /sbin/mingetty tty3
  371   4 S   0:00 /sbin/mingetty tty4
  372   5 S   0:00 /sbin/mingetty tty5
  373   6 S   0:00 /sbin/mingetty tty6
  375  ?  S   0:00 update (bdflush)
  381   1 S   0:00 -bash
  402  ?  S   0:00 in.telnetd
  436  ?  S   0:00 in.telnetd
  249  ?  S   0:00 /usr/sbin/atd
  327  ?  S   0:00 httpd
  328  ?  S   0:00 httpd
  329  ?  S   0:00 httpd
  330  ?  S   0:00 httpd
  331  ?  S   0:00 httpd
  332  ?  S   0:00 httpd
  333  ?  S   0:00 httpd
  334  ?  S   0:00 httpd
  335  ?  S   0:00 httpd
  403  p0 S   0:00 /bin/login -h calvin  raycomm.com -p
  404  p0 S   0:00 -bash
  437  p1 S   0:00 /bin/login -h calvin  raycomm.com -p
  438  p1 S   0:00 -bash
  449  p1 S   0:00 ispell gudspeler
  450  p0 S   0:00 script covermybutt
  451  p0 S   0:00 script covermybutt
  452  p3 S   0:00 bash -i
  455  p3 R   0:00 ps ax
[ejr@hobbes ch14]$ exit
Script done on Fri May 15 14:30:44 2009
[ejr@hobbes ch14]$

					  


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint