D:\JavaFrameworks\InsuranceFramework\src\java\unix_code\BourneShellCommands.properties
  1 #                               Bourne Shell Commands
  2 FILE COMMANDS: ********************************************************
  3 cat                /* Concatenate and display files. */
  4 $ cat my_file.c
  5 $ cat file_1  file_2  file_3
  6 
  7 cc                 /* C compiler call */
  8 $ cc my_prog.c     /* compile my_prog.c
  9 
 10 <,> & >>           /* Redirection of input and output plus append. */
 11 $ cc  my_prog.c > out_file.prt      /* direct output to out_file.prt */
 12 $ cc  my_prog.c < input_file.dat    /* direct input data from input_file */
 13 $ a.out >> out_file.prt             /* direct & append output to out_fil */
 14 
 15 chgrp              /* Change the group name of the file or directory. */
 16 $ chgrp new_group  file_name
 17 
 18 chmod             /* Change the permissions on a file or directory.*/
 19 $ chmod u+x   file_name
 20 $ chmod 755   file_name
 21 
 22 chown              /* Change owner of a file or directory. */
 23 $ chown new_name  file_name
 24 
 25 comm               /* Compare sorted files. */
 26 $ comm one two     /* List the difference and the common text between two
 27                           sorted files. */
 28 
 29 cp                 /* Copy files. DO NOT copy a file into itself you may
 30                       lose the original file contents. */
 31 $ cp old_file  new_file
 32 
 33 diff           /* Display the difference between two file line by line. */
 34 $ diff first second
 35 
 36 ed             /* Edit a file using line editor. */
 37 $ ed my_prog.c
 38 
 39 file           /* Find what kind of information is in a file. */
 40 $ file my_file.c
 41 
 42 find           /* Search for a file name or a command. */
 43 $ find my_lost_file.c
 44 
 45 grep           /* Search file for a given pattern and return it to screen*/
 46 $ grep PATTERN file_name
 47 $ grep joe my_file
 48 
 49 lp             /* Print a file   send to the printer. */
 50 $ lp my_file.c
 51 
 52 
 53 mv             /* Rename or move a file. */
 54 $ mv old_name new_name
 55 $ mv /bin/local/file_name   /usr/bin/file_name
 56 
 57 more           /* Display a file one screenful at the time. */
 58 $ more my_file
 59 
 60 pg             /* Display a file one page at the time. */
 61 $ pg my_file
 62 
 63 pr             /* Paginate a file for printing. Breaks file into pages for
 64                   printing & each page has a header with the file name,
 65 $ pr my_file      date, time and page number. */
 66 
 67 rm             /* Remove or delete files */
 68 $ rm his_file
 69 
 70 sort           /* Sort file(s) in ascending order to screen. */
 71 sort  r        /* Sort file(s) in descending order to screen. */
 72 $ sort my_file
 73 $ sort  r my_file
 74 
 75 touch          /* Update a file's modification time. */
 76 $ touch my_file
 77 
 78 uniq           /* Display lines within a file that are unique. */
 79 $ uniq prog_one.c
 80 
 81 vi             /* Editing a file using vi editor. */
 82 $ vi new_file.c
 83 
 84 wc             /* Count the # of line, # of words and # of characters
 85 $ wc one.c        within a file. */
 86 
 87 DIRECTORY  *************************************************************
 88 cd             /* Change directory. */
 89 $ cd directory_name
 90 $ cd /                   /* Change directory to the ROOT. */
 91 $ cd ..                  /* Change directory to the parent directory. */
 92 
 93 chgrp          /* Change the name of the group of the directory. */
 94 $ chgrp new_group  directory_name
 95 
 96 chmod          /* Change permission on the directory. */
 97 $ chmod 777  directory_name
 98 
 99 chown          /* Change owner on the directory. */
100 $ chown new_owner directory_name
101 
102 cpio           /* Create a backup copy of the directory. */
103 $ ls | cpio  o > /dev/rmt/0m
104               /* Copy the list of the file into the tap on /dev/rmt/0m. */
105 
106 find           /* Find directory. */
107 $ find directory_name
108 
109 ls            /* List the files within a directory. */
110 $ ls directory_name
111 
112 mkdir          /* Create a new directory. */
113 $ mkdir new_dir
114 
115 rmdir             /* Remove or delete a directory. */
116 $ rmdir dir_name
117 
118 dircmp         /* Compare directories contents. */
119 $ dircomp  one   two
120 
121 pwd            /* Give the name of the working directory. */
122 $ pwd
123 
124 ON LINE HELP ***********************************************************
125 apropos        /* Means "RELATED TO". Search on_line manual pages for a
126 $ apropos sort    command & display the documentation on the screen. */
127 
128 help          /* Display the help on a command. */
129 $ help
130 $ help sort
131 
132 man            /* Display on line documentation on a command. */
133 $ man sort
134 
135 PROCESS ****************************************************************
136 kill           /*  Terminate a process. */
137 $ kill 1234           /* kill PID   process id. */
138 $ kill -9 2345        /* kill the process PID numbered 2345 for good */
139 
140 ps             /* Give the process status. */
141 $ ps
142 
143 MAIL *******************************************************************
144 mesg [y/n]     /* To receive or not to receive mail. */
145 $ mesg n       /* Stop receiving messages. */
146 $ mesg y       /* Start receiving messages.*/
147 
148 write          /* Send a message to a logged in user. */
149 $ write log_name <CR>
150   message..
151 
152 wall           /* Write a message to all logged in users. */
153 $ wall message...
154 
155 mail or mailx   /* Mailing messages to a logged in or unlogged in user. */
156 $ mail logname
157   message..
158 $ mailx logname
159 
160 ENVIRONMENT ************************************************************
161 id             /* Print user & group id and name. */
162 $ id
163 
164 who            /* Display logged in user on the system. */
165 $ who
166 
167 who am i       /* Display login information about yourself. */
168 $ who am i
169 
170 logname        /* Change logname. */
171 $ logname
172 
173 passwd         /* Change or assign a password. */
174 $ passwd
175 
176 set          /* Show or set the environment variables and their values. */
177 $ set
178 $ set TERM=vt100    /* Set the variable TERM to terminal type  vt100. */
179 
180 stty           /* Show the interrupt commands. */
181 $ stty
182 
183 tty           /* Get terminal's name. */
184 $ tty
185 
186 
187 date           /* Print  or set the date. */
188 $ date
189 
190 time or timex          /* Print the time. */
191 $ time
192 $ timex
193 
194 sleep          /* delay for number of second. */
195 $ sleep 600       /* delay for 10 minutes. */
196 
197 read            /* Read input string from the std_input   keyboard. */
198 $ read $variable_name
199 
200 echo             /* Write or print to std.out   screen. */
201 $ echo $variable
202 $ echo yesterday when I was young
203 
204 cls or clear     /* clear screen. */
205 $ cls   or   $ clear
206 
207 cal             /* Display calendar of the month */
208 $ cal 9 1990    /* display the month number in the year 1990 */
209 $ cal sep 1990  /* Same as above */
210 $ cal 9 1752    /* for fun  */
211 
212 bc or dc        /* To use computer as calculator */
213 $bc <CR>
214   (23 + 89) * 4 <CR>
215 
216