Transferring Information between Windows NT-Based Applications

The script utility program makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript.

script filename

unixs2 $ script

Script started, file is typescript

 

unixs2 $ ls

Mail            ezwin            pitt-logo3.gif      sig.txt
Mailbox         kannan.tues      private             suggestion2.doc
News            kannan.xls       public              typescript
dead.letter     mail             review.doc

unixs2 $ cd public

 

unixs2 $ ls

					CS110          WARSHALL.NOTE     cs401       html 
					Seminar

unixs2 $ pwd

/afs/pitt.edu/usr26/novacky/public

 

unixs2 $ exit

Script done, file is typescript

 

To see the contents of the script file created , enter the command

more filename

 

To clear the screen, use the clear command. The screen is erased and the unix prompt is placed at the top of the screen.

unixs2 $ clear

 

Redirecting ("capturing" ) the results of a command to a file: command > filename

unixs2 $ ls

			
					CS110             WARSHALL.NOTE       cs401           html 
					Seminar

unixs2 $ ls > myFile

unixs2 $ more myFile

CS110

WARSHALL.NOTE

cs401

html

myFile <=== created by redirection

seminar

 

 

To generate a calendar for any year use the command.

cal year

                                     1929

         Jan                          Feb                 Mar
S   M  Tu  W  Th  F  S     S  M  Tu  W  Th  F  S     S  M  Tu  W  Th  F  S
1   2   3  4   5                            1  2                      1  2
6   7   8  9  10 11 12     3  4   5  6   7  8  9     3  4   5  6   7  8  9
13 14  15 16  17 18 19    10 11  12 13  14 15 16    10 11  12 13  14 15 16
20 21  22 23  24 25 26    17 18  19 20  21 22 23    17 18  19 20  21 22 23
27 28  29 30  31          24 25  26 27  28          24 25  26 27  28 29 30
                                                    31

Working with File protections/permissions unixs2 $ ls -al total 44 drwxr-xr-x novacky root 2048 Sep 21 16:22 . drwxrwxrwx novacky root 4096 Sep 21 16:12 .. drwxr-xr-x novacky _0003370 2048 Sep 21 10:05 CS110 -rw-r----- novacky _0003370 2262 Jul 30 10:06 WARSHALL.NOTE drwxr-xr-x novacky _0003370 2048 Mar 26 12:28 cs401 drwxr-xr-x novacky _0003370 6144 Sep 16 10:47 html -rw-r--r-x novacky _0003370 51 Sep 21 16:22 myFile
<== note others permissions drwxr-xr-x novacky _0003370 2048 Sep 16 08:58 seminar unixs2 $ chmod o-r myDirectory <== remove read protection for others unixs2 $ ls -al total 44 drwxr-xr-x novacky root 2048 Sep 21 16:22 . drwxrwxrwx novacky root 4096 Sep 21 16:12 .. drwxr-xr-x novacky _0003370 2048 Sep 21 10:05 CS110 -rw-r----- novacky _0003370 2262 Jul 30 10:06 WARSHALL.NOTE drwxr-xr-x novacky _0003370 2048 Mar 26 12:28 cs401 drwxr-xr-x novacky _0003370 6144 Sep 16 10:47 html -rw-r----x novacky _0003370 51 Sep 21 16:22 myFile <== read protection is removed drwxr-x--x novacky _0003370 2048 Sep 16 08:58 seminar unixs2 $ chmod o+rw myDirectory <== add read and execute permission unixs2 $ ls -al total 44 drwxr-xr-x novacky oot 2048 Sep 21 16:22 . drwxrwxrwx novacky root 4096 Sep 21 16:12 .. drwxr-xr-x novacky _0003370 2048 Sep 21 10:05 CS110 -rw-r----- novacky _0003370 2262 Jul 30 10:06 WARSHALL.NOTE drwxr-xr-x novacky _0003370 2048 Mar 26 12:28 cs401 drwxr-xr-x novacky _0003370 6144 Sep 16 10:47 html -rw-r--rwx novacky _0003370 51 Sep 21 16:22 myFile <==read/execute permissions added drwxr-xr-x novacky _0003370 2048 Sep 16 08:58 seminar   Sort the contents of a text file sort filename unixs2 $ sort names.txt Able, J Donzi, P Miller, T Miller, Z Stanley, L Pipe symbol | - send information into a program for processing information | program Example: ls -al | more <==see one screen at a time of the long directory listing.