1.3. Unix characters.   

On Unix there are several special characters that have important uses:


^D:end of input from terminal
Note:If you type ^D as input to shell then you
are indicating that you are finished with input
for the job and hence you are logged off!!!!
^H:backspace or delete the last character typed.
RUBOUT:kill the job running not rubout a character.
This is like Control C on many other systems.
@ :rubout the entire line, like ^U on other systems.
^V:Take the next typed character literally regardless
of what it would normally do!

There are also some special characters called meta- characters which are used to perform special tasks with the shell.

    *: like * on other systems to access multiple names.

% ls -l *.java<return>
access (give directory on) all files with extensions
of .java
% ls -l *temp*<return>
access all files that have the word temp somewhere
within the filename or extension.
An extension in Unix is nothing special.
&: used to start a new process or job.
Unix allows a user to start several processes/programs.
% javac file.java&<return>
4014 <--------Process id.
% ls -l <return>
The user can do a Java compile at the same time as an
ls. The Java compile doesn't have to finish before the
ls starts. Note that the output from Java will mix
with output from ls. Therefore be careful when using &.
Wait until you are more experienced.

Standard Input and Output and the metacharacters > < and |.

Any program on Unix that sends its output to your terminal can also send its output to a file.
Any program on Unix that receives its input from your terminal can also receive its input from a file.
This is very useful!!

This means that a program can easily get a copy of its output on disk or lineprinter, etc or that a program can be tested using a few sets of data and then run using a file that contains thousands. Unix has standard input and standard output which normally goto/comefrom your terminal. The I/O can be redirected to/from a file.

   % ls -l >file1 <return>

send output of ls program to file "file1"
% mail fred <message <return>
mail fred with text in file message.

It is possible to use the output of one program as the input of another. ie

            % produce>temp<return>

% analyse<temp<return>
Produce results, use result to produce final result.
These can be combined as one command
% produce | analyse <return>
Take standard output of "produce" and make it
the standard input of "analyse"

Most Unix programs allow their output to be piped to another program.

      % ls -l | pr -n | more<return>


Other shell commands/programs:

cat  :      type a file.

rm : delete a file.
lpr : print a file.
date : time and date.
cp : copy one file to another.
mv : rename or move one file to another.