As we progress, everything will seem unfamiliar, but actually relate very directly to some very familiar things you have seen working with a computer having a GUI. We assume you have basic proficiency using some kind of computer such as a Mac or a Windoze box, and we will relate the things you do in Linux to those you do in your usual operating system.
Log in to your UNIX account. If you are working in a Linux GUI, or a Mac, just open a terminal session. The first thing you will see after any password challenge will resemble this
yourUserName@hostName yourUserName]$
On a Mac, it will resemble this or this
John-Morrisons-MacBook-Pro:~ morrison$
The presence of the prompt means that the operating system is waiting
for you to enter a command. The token yourUserName
will
show your login name. Your prompt may have an appearance different from
the ones shown here; this depends on how your system administrator sets
up your host or on the type of Linux distribution you are using. The
appearance of your prompt does not affect the underlying performance of
UNIX. In fact, the properties of your session are highly configurable,
and you can customize your prompt to have any appearance you wish.
To keep things simple and uniform throughout the book, we will always
use unix>
to represent the UNIX prompt. You will
interact with the operating system by entering commands, instead of
using a mouse to push buttons or click in windows.
When you see this terminal, a program called a shell is running. The shell takes the commands you type and passes them on to the operating system (kernel) for action. You will type a command, then hit the ENTER key; this causes the command to be shipped to the OS by the shell. The shell then conveys the operating system’s reply to your terminal screen. Think of the shell as a telephone through which you communicate with the operating system. This analogy is only fitting since UNIX was originally developed at AT&T Bell Labs.
We will begin by learning about the structure of a UNIX command. These commands will give you access to your programs and data, so what is to follow is very fundamental.
Before we start there are three important items to know about.
stdin
This is standard input, which by default is the keyboard.stdout
This is standard output, which by default is the terminal screen.stderr
This is standard error, which by default is the also the terminal screen.
As we progress, you will see that UNIX thinks of these things as being files. In fact it thinks everything is a file. You will also learn that these things can be redirected into files and other places.