Читаем 100 Shell Programs in Unix полностью

UNIX is an operating system which was first developed in the 1960s, and has been under constant development ever since. By operating system, we mean the suite of programs, which make the computer work. It is a stable, multi-user, multi-tasking system for servers, desktops and laptops. UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows, which provides an easy to use environment. UNIX (and Linux, which is Linus Torvald’s version of UNIX) has deep roots in the computer industry. UNIX is a very powerful multitasking and multi-user system. Multitasking means a user can run multiple programs simultaneously with in one single login of the system. Multi-user means that many users can simultaneously and securely use the same machine with their separate dumb terminals. The following figure shows a typical UNIX setup:

II. SALIENT FEATURES OF UNIX

Among many salient features the UNIX offers, few are listed below:

Multi-user

Multitasking

Communication

Security

Portability

Capability

Time sharing

Command interpreter & background processing

Hierarchical file system

Dos-Unix interface

Simple command

System administration & job accounting

Tools & utilities

Shell programming

Availability of 4GL and RDBMS

Library of application packages

III. HARDWARE REQUIREMENTS FOR UNIX

There are some prerequisites for a system that can host and take best advantage of UNIX. These are a PC/AT or higher with an 80 MB hard disk and at least 4MB of RAM on a 16-bit microprocessor (80286/80386/80486). The dumb terminals are connected to the host machine through a 4/8/16 port controller card installed in the expansion slot on the motherboard of the host machine. More the number of terminals more should be the memory on the host machine. Out of 80 MB disk space, almost 40MB is eaten away by the actual UNIX OS files and another 10-20 MB is used as swap space. For each terminal to be supported, 0.75 to 1 MB should be present in the host machine.

IV. GETTING STARTED

A system administrator supervises the working of UNIX on any installation. In UNIX, there are different types of accounts. The root account is the administrator user account. It has the most privileges available to the system. Then are individual user accounts having far fewer privileges. Access to many user accounts can also be controlled at once by assigning users to groups. UNIX is case sensitive and is strongly oriented towards devices with lower case. The system administrator configures every individual on the system and supplies them with credentials (username and password).

1. Logging-in

Given that your terminal is connected to the host computer and is powered on, the display prompts you for your login name.

login:

When you get the login: message, type your login name. Follow it by pressing RETURN, after which you receive the password prompt.

password:

At this stage, you must type in your password.

You get three to five attempts to get the login — password combination right before your terminal is disconnected. Once you successfully login, you get a prompt, usually a single character, indicating that the system is ready to accept commands from you. The prompt is most likely to be a dollar sign ($) (for Bourne Shell), or a percent sign (%) (for C Shell), but you can change it to anything you like.

2. Typing Commands

On receiving the prompt, commands can be typed. When you see the prompt ($), type who am I and press RETURN.

$ who am i

tom tty 3a Jul 18 10:10

The system should reply with your user name, system’s name, and when the user logged on. If you make a mistake typing the name of a command, you will be told that no such command exists:

$ today’s date

today’s date: not found

You have two ways to recover from your typing mistakes, provided you see them before you press RETURN:

(i) You type the line kill character (@). It kills the whole line and you can type the whole line again.

(ii) Use erase characters one at a time using #. Each # erases the last character typed. For example,

$ who a i@

who am i

tom tty3a Jul 18 10:10

$ www##ho aa#mi# i

tom tty3a Jul 18 10:10

3. Some Special Keys

RETURN key — The RETURN key signifies the end of a line of input. On any terminal, RETURN has a key of its own, or return may be typed by holding down the control key and typing a ‘m’.

DELETE: The DELETE key stops a program/command immediately, without waiting for it to finish. DELETE can be achieved equivalently with ctrl-c.

Ctrl-s: Ctrl-s pauses the output and the program is suspended until you start it again.

Ctrl-q: Ctrl-q resumes the program paused by ctrl-s.

Ctrl-g: rings a bell on the terminal.

Ctrl-h: can be used for backspace.

Ctrl-I: can be used for tab (eight spaces on UNIX system).

4. Logging out

Logout marks the end of a UNIX session. A user can log out by either typing ctrl-d or exit at the prompt.

Похожие книги