Linux Basics June2012
date post
05-Apr-2018Category
Documents
view
218download
0
Embed Size (px)
Transcript of Linux Basics June2012
7/31/2019 Linux Basics June2012
1/57
Linux Fundamentals
Courseware Designed & Written by
P Narasimhan
Acknowledgement
Some portions of this reference documentation has been derived from various sources including
the HOWTO's, Guides from the Linux Documentation Project , Man & Info pages, FAQ's and
technical articles from several other sources on the World Wide Web. We are thankful to and do
hereby sincerely acknowledge the creators of these documents.
This courseware is given free of cost as a reference material covering the topics dealt with during
the training programme(s), precisely for internal circulation only and is not intended for sale
anywhere.
Linux is the Trademark of Linus Torvalds and all other brand names and trademarks are
properties of their respective owners.
P Narasimhan
7/31/2019 Linux Basics June2012
2/57
No Warranty Clause
The authors disclaim all warranties with regard to this document and the configurations covered
thereto, including all implied warranties of merchantability and fitness for a certain purpose. In no
even shall the authors be liable for any special, indirect or consequential damages or any damage
whatsoever resulting from loss of data, or profits whether in action of contract, negligence or other
tortuous action, arising out of or in connection with the use of this document or any of the
software mentioned therein .
P Narasimhan
7/31/2019 Linux Basics June2012
3/57
7/31/2019 Linux Basics June2012
4/57
CH A P T E R - 1 : AN O V E R V I E W O F TH E OR I G I N S O F UN I X AN D
LI N U X
During the early days of computing it was very difficult to interact with computers
as many of the luxuries with which we are familiar today were not available those
days. It was left to a few dedicated Engineers at AT&T ( Bell Laboratories) to
initiate research to arrive at what is now known as an Operating System during the
early 1960's. They named the project as 'MULTICS' (Multiplexed Information &
Computing Systems) and the other organisations which formed part of this were
General Electric Co. and MIT. As sufficient interest was not shown by the othersAT&T walked out of this project and initiated a new one, UNICS later renamed as
Unix. The first version was created in Bell Labs in the year 1969 initially through
assembler code( Machine Level Language) and later ported to a new high level
programming language called B, which was co-developed by Ken Thompson and
Dennis Ritchie. The Unix operating system thus developed was ported on to PDP
machines which were lying unused. It is quite interesting to note that this high-end
OS along with its' source code was given away for as low a price as US $ 15-00 by
AT&T.
Further development took place and a higher and more powerful language C came
into existence, once again at Bell Labs. The entire code of Unix was rewritten in 'C'
by the year 1973. This version of Unix came to be known as System V with releases
up to 4 and christened as SVR4. Moreover the AT&T Unix code was used by a
P Narasimhan
7/31/2019 Linux Basics June2012
5/57
research group at University of California, Berkeley known as Berkeley Software
Distribution (BSD). The BSD group made significant contribution in the area of
development of various applications for Unix broadly referred to as BSD
tools/utilities. However, the same AT&T code was purchased by hardware giants
such as IBM, HP, Sun Micro Systems who made changes to suit their hardware
architecture and sold the modified OS under different brand names as AIX, UX , and
Sun OS(renamed later as Solaris) respectively. Thus it is recorded that Unix became
a proprietary OS and a hand maid in the hands of the companies almost to the end of
1970's, although the basic work was done by the dedicated researchers at Bell
Laboratories.
The basic beauty of the design methodology is that the output of one program can be
the input for another. This gives the user the flexibility to combine many small
programs together to perform a larger, more complex task instead of relying upon amonolithic single application.
In the year 1984, Richard Stallman, a research student at MIT started the GNU
Project (GNU's Not Unix), a recursive acronym to refer to an environment to develop
a FREE version of a complete Unix-like operating system which is free software:
the GNU system. Variants of the GNU operating system, which use the kernel called
Linux, are now widely used; though these systems are often referred to as Linux,
they are more accurately called GNU/Linux systems.
GNU is a recursive acronym for GNU's Not Unix; it is pronounced guh-noo, like
canoe. Many of the free software applications are under GNU's General Public
License orGPL in short which forms the legal back bone . The current version is 2.0
but version 3.0 is already framed and goes much beyond the terms of the older one
offering greater freedom to the users & developers.
What is Free Software?
``Free software'' is a matter of liberty, not price. To understand the concept, youshould think of ``free'' as in ``free speech,'' not as in ``free beer.''
Free software is a matter of the users' freedom to run, copy, distribute, study, change
and improve the software. More precisely, it refers to four kinds of freedom, for the
users of the software:
P Narasimhan
http://www.gnu.org/philosophy/free-sw.htmlhttp://www.gnu.org/gnu/linux-and-gnu.htmlhttp://www.gnu.org/philosophy/free-sw.htmlhttp://www.gnu.org/gnu/linux-and-gnu.html7/31/2019 Linux Basics June2012
6/57
The freedom to run the program, for any purpose (freedom 0).
The freedom to study how the program works, and adapt it to your needs
(freedom 1). Access to the source code is a precondition for this.
The freedom to redistribute copies so you can help your neighbor (freedom 2).
The freedom to improve the program, and release your improvements to the
public, so that the whole community benefits (freedom 3). Access to the
source code is a precondition for this.
He wanted the GNU Project to initially develop applications ,the ultimate goal being
the design of a new 32-bit kernel when the hardware industry would be read for such
an eventuality. He wanted to prevent such occurrences as seizure of software in the
future and hence created a legal basis in the form of General Public License or GPL
as it has come to be known as. Under the GNU GPL Act, the software is first
Copyrighted by the creator of software, thereby preventing someone else from seizing
control of it at a later date. Rights are granted to the public to use, copy, redistribute,
and also to modify/recreate freely under certain carefully defined conditions. These
developments have necessarily to carry with them the source code of the originally
created one and the modified source as well. The withholding of source code will be
viewed as curtailment of programmer's freedom to modify & improve software. His
goal was to recreate an environment free of restrictions with utilities and tools that are
totally 'Free'.
The GNU ( GNU's Not Unix )Project is being administered by Free Software
Foundation which was established to help raise funds for making free software. FSF
is the principal organizational sponsor of the GNU Project. The FSF receives very
little funding from corporations or grant-making foundations, but relies on support
from individuals. Richard Stallman a formidable programmer himself, wrote anamazing amount of software which includes the GCC (GNU 'C' Compiler) and the
versatile 'EMACS' editor.
The Minix (Miniature Unix on Intel 386) project was initiated by that famous
Professor Andrew Tannenbaum in 1989 as an educational version of Unix.
P Narasimhan
7/31/2019 Linux Basics June2012
7/57
Unfortunately this code could not execute bsd or gnu applications on Intel 386 based
systems as it was intended to be. The MINIX project took a new turn with the
involvement of a 21 year-old Finnish Computer Science Student at the University of
Helsinki, named Linus Benedict Torvalds in the year 1991. He made modifications to
the MINIX code with which he successfully executed a few Unix programs on Intel-
386 box. He posted the code on Minix Mail Group with a request to other
programmers to help him build it, precisely on 25th August, 1991. The response was
overwhelming and went beyond the wildest expectations. What began as a student
hobby project rapidly developed into a serious efforts at developing an operating
system within a short period of a couple of months.
P Narasimhan
7/31/2019 Linux Basics June2012
8/57
Torvalds found everything that is required of an OS in BSD and GNU utilities with
which he integrated his kernel, Linux. He put all this together and wanted to name the
OS as FREAX, perhaps to denote it's freak development. However, his friends
persuaded him to associate the OS with himself: Linux, Linus's Unix which he did
after much hesitation. It is interesting to note that from the very inception Linux
development took place on a collaborative and collective basis involving thousands
of users/developers across the net. This scenario led a prominent Unix develop