Of 25 from the Desk of Mr. Manjunatha Balluli, Shree Medha College
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to UNIX (Module I) History of UNIX UNIX development was started in 1969 at Bell Laboratories in New Jersey. Bell Laboratories was (1964–1968) involved on the development of a multi-user,time-sharing operating system called Multics (Multiplexed Information and Computing System). Multics was a failure. In early 1969, Bell Labs withdrew from the Multics project. Bell Labs researchers who had worked on Multics (Ken Thompson, Dennis Ritchie, Douglas McIlroy, Joseph Ossanna, and others) still wanted to develop an operating system for their own and Bell Labs’ programming, job control, and resource usage needs. When Multics was withdrawn Ken Thompson and Dennis Ritchie needed to rewrite an operating system in order to play space travel on another smaller machine (a DEC PDP-7 [Programmed Data Processor 4K memory for user programs). The result was a system called UNICS (UNiplexed Information and Computing Service) which was an 'emasculated Multics'. The first version of Unix was written in the low-level PDP-7 assembler language. Later, a language called TMG was developed for the PDP-7 by R. M. McClure. Using TMG to develop a FORTRAN compiler, Ken Thompson instead ended up developing a compiler for a new high-level language he called B, based on the earlier BCPL language developed by Martin Richard. When the PDP-11 computer arrived at Bell Labs, Dennis Ritchie built on B to create a new language called C. Unix components were later rewritten in C, and finally with the kernel itself in 1973. Unix V6, released in 1975 became very popular. Unix V6 was free and was distributed with its source code. In 1983, AT&T released Unix System V which was a commercial version. Meanwhile, the University of California at Berkeley started the development of its own version of Unix. Berkeley was also involved in the inclusion of Transmission Control Protocol/Internet Protocol (TCP/IP) networking protocol. The following were the major mile stones in UNIX history early 1980's • AT&T was developing its System V Unix. • Berkeley took initiative on its own Unix BSD (Berkeley Software Distribution) Unix. • Sun Microsystems developed its own BSD-based Unix called SunOS and later was renamed to Sun Solaris. • Microsoft and the Santa Cruz operation (SCO) were involved in another version of UNIX called XENIX. • Hewlett-Packard developed HP-UX for its workstations. • DEC released ULTRIX. • In 1986, IBM developed AIX (Advanced Interactive eXecutive). From the desk of Mr. Manjunatha Balluli, Shree Medha College, Ballari Page 1 of 25 Introduction to UNIX (Module I) Salient Features of UNIX Following are some of the important features of Unix Operating System. Portable − Portability means software can work on different types of hardware in same way. Unix kernel and application programs supports their installation on any kind of hardware platform. Open Source − Unix source code is freely available and it is community based development project. Multiple teams work in collaboration to enhance the capability of Unix operating system and it is continuously evolving. Multi-User Capability: - Multi-user operational system permits several users to use the same computer to carry out their job. Several terminals are connected to a single powerful computer and each user of the terminal can be a programmer, program access files and prints document at the same time. Need for the multi-user environment arises when several programmers work on developing module of the same software. Multi-user environment ensures complete coordination and compatibility and saves a considerable amount of time by allowing several users on a set of information at a time. Buying single multi- user computer is far more economical and efficient than buying several single users computers. Multiprogramming − Unix is a multiprogramming system means multiple applications can run at same time. Multitasking Capability: - This capability allows the system to perform several tasks simultaneously. For instance, UNIX can print one document, edit another and sort a list of files at the same time. Multiple tasks can be carried out by placing other tasks in the background while you work on one task at a time. The current tasks are said to be in the foreground. Normally the tasks that do not require active interaction from the user are placed in the background; the lower will be the system response. Hierarchical File System − Unix provides a standard file structure in which system files/ user files are arranged. Shell − Unix provides a special interpreter program which can be used to execute commands of the operating system. It can be used to do various types of operations, call application programs. etc. Security − Unix provides user security using authentication features like password protection/ controlled access to specific files/ encryption of data. Communication: - UNIX supports two major types of communication: 1. Communication between different terminals connected to the same computer. 2. Communication between users of the one computer at the specific location to the users of another type and size of a computer located elsewhere. The two computers may be located in different offices or different countries or continents. These types of communication is achieved by a mail system based on wide area and may be connected through telephone lines or satellite. From the desk of Mr. Manjunatha Balluli, Shree Medha College, Ballari Page 2 of 25 Introduction to UNIX (Module I) UNIX Architecture The following illustration shows the architecture of a UNIX system − The architecture of a UNIX System consists of the following layers – Kernel The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and handles the file store and communications in response to system calls. As an illustration of the way that the shell and the kernel work together, suppose a user types rm my file (which has the effect of removing the file my file). The shell searches the file store for the file containing the program rm, and then requests the kernel, through system calls, to execute the program rm on my file. When the process rm my file has finished running, the shell then returns the UNIX prompt % to the user, indicating that it is waiting for further commands. Amongst the functions performed by the kernel are: Managing the machine's memory and allocating it to each process. Scheduling the work done by the CPU so that the work of each user is carried out as efficiently as is possible. Organising the transfer of data from one part of the machine to another. Accepting instructions from the shell and carrying them out. Enforcing the access permissions that are in force on the file system. The shell: The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. The commands are themselves programs: when they terminate, the From the desk of Mr. Manjunatha Balluli, Shree Medha College, Ballari Page 3 of 25 Introduction to UNIX (Module I) shell gives the user another prompt (% on our systems). The user can customise his/her own shell, and users can use different shells on the same machine. The shell keeps a list of the commands you have typed in. If you need to repeat a command, use the cursor keys to scroll up and down the list or type history for a list of previous commands. You can use any one of these shells if they are available on your system. And you can switch between the different shells once you have found out if they are available. Bourne shell (sh) C shell (csh) TC shell (tcsh) Korn shell (ksh) Bourne Again SHell (bash) Features of Shell: Shell Features Description Command interpreter Shell interprets the valid user entered commands to the kernel understandable language. Shell should understand which program to be invoked in order to perform that command. Prompts Ideally prompts are shown as “$” or “#” Shell scripts Uses multiple shell commands logically to create a script i.e. runs more than one commands at a time. I/O redirection and Pipes These features in Shell allow connecting programs together and making programs process their inputs from files Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc). Utilities and Application The final layer of the UNIX OS is the Utilities and Applications layer. This layer includes the commands, word processors, graphic programs and database management programs. Traditionally, these programs were accessed by typing the commands to start the program on the command line. They can still be accessed in this way, but they can now also be accessed through the GUI. UNIX command format Syntax of UNIX Commands UNIX commands can be very simple one word commands or they can take a number of additional arguments (parameters) as part of the command. In general, a UNIX command has the following general form... From the desk of Mr. Manjunatha Balluli, Shree Medha College, Ballari Page 4 of 25 Introduction to UNIX (Module I) Command options(s) filename(s) Let’s look at each of these parts a bit more closely... The command is the name of the utility or program that we are going to execute. The options are passed into the command to modify the way the command works. It is typical for these options to have be a hyphen followed by a single character, such as-l. It is also a common convention under Linux to have options that are in the form of 2 hyphens followed by a word or hyphenated words, such as --color or --pretty-print.