236 You Are Here
Summary: To clear clutter in a console or xterm window type clear;toreturnan
xterm window to its default display properties, type reset.
16.6 Using cat
There’s a handy utility which can help you keep short lists, gather those lists together and, at the
same time, show you a little of the power behind your Red Hat Linux system.
The utility is called cat,shortfor“concatenate,” which means that it strings files together.
But cat can also perform a quick demonstration of two important terms: standard input and standard
output.
Standard input and standard output direct input and output (often referred to as I/O)totheuser.If
a program reads from standard input, it will, by default be reading from the keyboard. If a program
writes to standard output, by default it will be writing to the screen.
Let’s start cat to see what this means. At the shell prompt, type:
cat
The cursor moves to a blank line. Now, in that blank line, let’stype:
stop at sneaker store
and press the
Enter key. Suddenly, your screen looks like:
[billy@localhost billy]$ cat
stop by sneaker store
stop by sneaker store
To quit cat now, just move the cursor to a blank line by pressing
Enter then press the Ctrl and D
keys at the same time.
So it’s not too exciting. But cat has just demonstrated the definition of standard input and standard
output. Your input was read from the keyboard (standard input), and that input was then directed
to your terminal (standard output).
Summary: Standard input is often text which is entered from the keyboard. Standard
output is the place where information is sent, such as your terminal (as shown in Figure
16.11).
Comments to this Manuals