Java Reference
In-Depth Information
So let's get started. Once you've logged in to your Linux system, regardless
of which windowing system you are using—KDE, Gnome, Window Maker,
and so on, start up an xterm window by running xterm (or even konsole ) and
you'll be ready to type these commands. 1
1.3.1
The second great accomplishment of UNIX, 2 carried on into its Linux descen-
dants, was the concept of redirecting input and output (I/O). It was based on
the concept of a standardized way in which I/O would be done, called
standard I/O .
Redirecting I/O
1.3.1.1
A familiar concept to Linux developers is the notion of standard I/O. Virtually
every Linux process begins its life with three open file descriptors—standard
in, standard out, and standard error. Standard in is the source of input for the
process; standard out is the destination of the process' output; and standard
error is the destination for error messages. For “old fashioned” command-line
applications, these correspond to keyboard input for standard in and the output
window or screen for both standard out and error.
A feature of Linux that makes it so adaptable is its ability to redirect its
I/O. Programs can be written generically to read from standard in and write to
standard out, but then when the user runs the program, he or she can change
(or redirect) the source (in) or destination (out) of the I/O. This allows a
program to be used in different ways without changing its code.
Redirecting I/O is accomplished on the Linux shell command line by the
“<” and “>” characters. Consider the ls program which lists the contents of a
directory. Here is a sample run of ls :
Standard I/O
$ ls
afile more.data zz.top
$
1. If you're not using a windowing system, these commands are typed at the shell prompt that
you get after you log in. But if you're not using a windowing system, either you're not a begin-
ner (and don't need this introduction) or you can't get your windowing system to work, in
which case you may need more help that we can give you here.
2. Yes, we are aware that much of UNIX actually comes from the Multics project, but we
credit UNIX with popularizing it.
Search WWH ::




Custom Search