50
Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Embed Size (px)

Citation preview

Page 1: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Introduction to Linux

Instructor: Bennett M. Tanyag

UNIT 1

Page 2: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Course Outline

Part 1Unit 1: Introduction to LinuxUnit 2: Using the Linux SystemUnit 3: Using the Linux System (Lab)Unit 4: Files and DirectoriesUnit 5: File and Directories (Lab)

Page 3: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Unit 1: Introduction to Linux

DescriptionThis unit provides an overview of the

course on Linux. It also introduces some of the preliminary concepts of Linux as an OS with growing popularity. The hardware requirements of Linux, structure and text processing are the main components of this unit.

Page 4: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Learning Objectives

To understand what an operating system is To know about the UNIX operating system To learn about the history of Linux, and it’s hardware

requirements To gain an understanding about the organization of the

Linux operating system To understand what a kernel, a file system and a shell in

Linux is To know about text processing and programming on

Linux operating systems

Page 5: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

What is an Operating System?

A program which acts as an interface or an intermediary between a user of a computer and the computer hardware.

A system program which controls all of the system’s resources and provides an environment in which a user can execute programs.

Page 6: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

An operating system can be thought of as the glue between user programs and the programs that control the computer’s hardware.

The process of starting the OS is called bootstrapping or booting. The computer knows “how to boot.” The instructions for booting are built into one of the chips of the computer, called the BIOS (Basic Input/Output System) chip. The BIOS informs the computer to look for a special program called a boot loader.

What is an Operating System?

Page 7: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The boot loader is available in a fixed place on the boot disk. The boot disk is the lowest-number hard disk on any computer. It is the boot loader that starts the real operating system.

Without the OS, the computer is just a “dumb” machine, a lump of electronic circuitry.

What is an Operating System?

Page 8: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The UNIX Operating System

During the mid 60’s, AT&T Bell Labs was developing an interactive operating system called MULTICS using a GE 645 computer. However, the project became very expensive and by 1969, Bell Labs abandoned this undertaking (although MIT and GE continued the project).

Two of the programmers involved in the MULTICS venture, Ken Thompson and Dennis Ritchie, were in need of a new computing environment. At Bell Labs, they found a discarded PDP-7 computer with no operating system. So to make the machine run, they wrote their own operating system based on MULTICS. Using the PDP-7 assembly language, the first version of UNIX was born in 1970.

Page 9: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Computers used – GE 645

http://www.multicians.org/multics-hardware.html

Page 10: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Computers used – PDP 7

http://www.melbournelinux.com/gif/PDP-7.gif

Page 11: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Thompson and Ritchie rewrote an operating system to play a space war game with another smaller machine. This OS was called UNiplexed Information and Computing Service (UNICS), a pun on the original Multics. The name UNICS was later transformed to UNIX and know to be one of the most powerful, versatile and flexible OS.

In 1971, Brian Kerningham and Dennis Ritchie developed C-Language. Since this new programming language is almost as efficient as assembly language, they rewrote UNIX in 1973 using C.

The UNIX Operating System

Page 12: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The UNIX Operating System

In 1974, Thompson and Ritchie published a paper regarding their work that caused a lot of interest in the academe. AT&T then began licensing UNIX to different universities. Development of UNIX continued within Bell Labs and also outside particularly at the University of California at Berkeley.

UNIX became popular as a program development and teaching environment and many institutions of higher learning adopted it. UNIX became a powerful tool for research and development.

Page 13: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The UNIX Operating System

At AT&T, the system programmers were trying to make UNIX a dominant commercial operating system. In 1981, AT&T released UNIX System III which gave UNIX more tools. In 1983, AT&T released UNIX System V and UNIX became a true commercial operating system.

Graduate students at the University of California in Berkeley started developing their own version of UNIX. In 1981, they released 4.1 BSD (Berkeley Software Distribution). By 1983, they released 4.3 BSD which became popular as a commercial operating system due to its added tools and capabilities.

Page 14: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

UNIX VARIANTS AIX - from IBM HP-UX - from Hewlett-Packard ULTRIX - from DEC XENIX - from Microsoft OSF/1 - from Open Software

Foundation SOLARIS - from Sun Systems

The UNIX Operating System

Page 15: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

History of Linux

In 1991, Linus Torvalds, a student of the University of Helsinki in Finland, developed an OS, with support from developers all over the world and named it Linux.

He released version 0.02 of Linux in 1991. In 1994 version 1.0 of Linux was released.

The current full-featured version is 2.4, released in January 2001, and development still continues.

Page 16: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Who is Linus Torvalds?born December 28th 1969 Helsinki, Finland 

creator of Linux computer operating system

In 1991 Linus Torvalds, a 21-year-old computer science student at the University of Helsinki. He purchased his first personal computer and was not satisfied with the computer's operating system (MS-DOS). But Torvalds preferred the UNIX operating system he had used on the university's computers.

Months of determined programming work yielded the beginnings of an operating system known as Linux that, eight years later, developed into what many observers saw as a genuine threat to mighty Microsoft

By the time he reached college, Torvalds considered himself an accomplished enough programmer to take on the Herculean task of creating an alternate operating system for his new PC.

http://www.thocp.net/biographies/torvalds_linus.html

Page 17: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

History of Linux

The Linux operating system is developed under the GNU General Public License. The GNU License allows the source of Linux to be distributed freely and to be made available to the general public. Linux systems are used for networking, software development, hosting web-based solutions and as end-user platforms.

The official mascot which Linus chose for his operating system is the Linux Penguin.

Page 18: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Linux is not a derivative of the UNIX source code. However, the interface of Linux is intentionally like UNIX. Thus, concepts and information on security is applicable to both UNIX and Linux.

Linux is a stable and versatile operating system, especially as a network server.

History of Linux

Page 19: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Linux Hardware Requirements

Linux is available for a number of platforms besides the Intel 8086 systems. The following are different hardware requirements for Linux.

Hardware Requirements

CPU 80386,80486,Pentium, DEC Alpha and Apple Power Mac

Motherboard PCI,EISA,VESA, and MCS bus systems.

Memory 4 Mb (min), 16 Mb or higher (recommended)

Hard Drive Controller IDE,EIDE,MFM and RLL controllers. Most ESDI controllers are supported

Page 20: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Linux Hardware RequirementsHardware Requirements

HDD space 20 MB recommended for installation.

200 MB – 1 GB for multiple users to work on the system

Monitor and Video Adapter CGA,EGA,VGA, IBM monochrome, Super VGA and other accelerated video cards

Pointing Devices Standard mouse

CD-ROM Drive Standard CD-rom drive

Tape Drives Any SCSI tape drive

Printers Any parallel printers

Modems Any serial modems (internal or external)

Ethernet Cards Any LAN cards

Page 21: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Linux Distributions

There are a number of Linux distributions. We give below a list of such distributions Corel Linux – Corel Debian GNU/Linux – Debian DragonLinux – DragonLinux easyLinux – Easy Information Technology Elfstone Linux – Elfstone Software Beehive Linux – Beehive Team BestLinux – SOT Finnish Software Eng. Ltd. BlueCat Linux – LynuxWorks Caldera OpenLinux – Caldera Connectiva Linux – Connectiva Red Hat Linux – Red Hat Software SuSE Linux – SuSE Inc.

Page 22: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Organization of the Linux Operating System The Linux system is functionally organized

at 3 levelskernelshellTools and applications

Page 23: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Kernel is the heart of a UNIX system It is a collection of programs, mostly written in C. Kernel communicate with the hardware directly. There is only 1 kernel for any system. Important tasks of a kernel are:

To check to see if the user is an authorized one To keep track of all the various programs being run and allot time to

each program in turn To assign storage for files on the system To run the shell program To handle the transfer of information between the computer and the

terminals. In traditional parlance, kernel is the operating system.

Organization of the Linux Operating System - kernel

Page 24: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The kernel, the UNIX operating system program itself. It manages the interaction and use of a computer’s major resources (CPU, memory, and I/O devices).

The kernel has 3 components:

1. Scheduler

2. Memory Manager

3. Device Drivers

Organization of the Linux Operating System - kernel

Page 25: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Handles the task of starting and stopping the various processes running on the machine.

In operating systems, a scheduler is a program that coordinates the use of shared resources, such as a printer.

Organization of the Linux Operating System – kernel - scheduler

Page 26: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Controls the allocation of sections of memory to each process.

The memory manager controls the system's RAM and normally creates a larger virtual memory space using a file on the hard disk.

Organization of the Linux Operating System – kernel – Memory Manager

Page 27: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Directly control the terminals, disk drives, tape drives, and other peripheral hardware.

A driver acts like a translator between the device and programs that use the device. Each device has its own set of specialized commands that only its driver knows. In contrast, most programs access devices by using generic commands. The driver, therefore, accepts generic commands from a program and then translates them into specialized commands for the device.

Organization of the Linux Operating System – kernel – Device Drivers

Page 28: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Every operating system uses a “shell” to get commands from the keyboard to the computer.

Shell is just another program, again written in C. The shell is the interpreter between the kernel and the user

programs. Shell translates user commands into action. Shell interacts with the user while the kernel interacts with the

machine’s hardware. There are several types of shells in Linux The most commonly used ones are the Bourne Shell and the C

Shell. Both the shells are command driven.

Organization of the Linux Operating System - Shell

Page 29: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The shell, the user interface to the kernel. It accepts commands from the system input to be passed on to the kernel for execution.

Different Types of Shell

1. C Shell

2. Korn Shell

3. Bourne Shell

Organization of the Linux Operating System - Shell

Page 30: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Tools and Applications

Typically these are user programs UNIX provides a number of tools, built in while

the operating system is loaded. Tools can also be provided by third party

vendors Tools are grouped to perform certain functions

such as programming, business applications, word processing etc.

Page 31: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The tools, which are the different programs that are necessary in order to build and debug programs; facilitate data communications and run networks; create, edit and manipulate files; and other day-to-day tasks.

Tools and Applications

Page 32: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

The application programs such as text processing (WordPerfect, Microsoft Word, etc.), business software (FoxPro, Lotus 1-2-3, Excel, etc.), and many others.

Tools and Applications

Page 33: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

FEATURES/CHARACTERISTICS OF UNIX

It has multi-tasking capabilities. It has the ability to seemingly execute multiple programs at the same time.

It has multi-user capabilities. UNIX allows many users to access applications or processing power from a single machine at the same time.

Page 34: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Since UNIX was developed primarily for AT&T’s internal use only, secrecy was never emphasized. The developers wanted an operating system wherein sharing of data is easily facilitated. The result was an environment strong in communications and networking.

In fact, UNIX is the primary operating system of majority of the machines connected to the Internet. The Internet was created and thrives in the UNIX world.

FEATURES/CHARACTERISTICS OF UNIX

Page 35: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

UNIX is rich in tools programmers need since it was designed essentially as a programming environmentThe UNIX shell is programmable. UNIX is therefore one of the most flexible operating systems available.

Commands are difficult to understand and use. And UNIX responses to commands are terse. UNIX will not report the successful completion of a command.

However, UNIX users can easily use shell programming to personalize or customize their system and make it more user friendly.

FEATURES/CHARACTERISTICS OF UNIX

Page 36: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

UNIX is device independent (each device is viewed or treated as a separate file).

Because UNIX is written in C, it can virtually run in any machine with a C compiler. It is not tied to any particular hardware implementation. UNIX is therefore, one of the most portable operating systems available.

Portability is merely the ability to transport an operating system from one platform to another so that it still performs the same it should. The many variants of UNIX can operate in any environment and on any platform, from laptops to mainframes.

FEATURES/CHARACTERISTICS OF UNIX

Page 37: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

ADVANTAGES OF USING LINUX

Linux is the only operating system today that is freely available to provide multitasking, multiprocessing capabilities for multiple users on IBM PC-compatible hardware platforms.

Many applications for Linux are freely available on the Internet, just as the source code to Linux itself is available on the Internet. Thus, the user has access to the source code to modify and expand the operating system to his or her needs. This is something that cannot done with commercial operating systems like Windows 98, MS-DOS, or OS/2.

Page 38: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Linux comes with a complete implementation of the TCP/IP networking protocol thereby allowing instant connection to the Internet.

Linux has a complete e-mail system to send messages back and forth through cyberspace.

There is also a complete graphical user interface (GUI) for XFree86, that is based on the popular X windows system.

ADVANTAGES OF USING LINUX

Page 39: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Linux provides a wealth of tools for program development. There are compilers for many of the top computer programming languages today such as C, C++, and SmallTalk.

ADVANTAGES OF USING LINUX

Page 40: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

DISADVANTAGES OF USING LINUX

There is no single corporate entity in charge of its development. Therefore, there is no formal source of technical support or help.

However, users may still get help from millions of Linux users through the Internet.

Page 41: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Linux can be hard to install and does not work on all hardware platforms. Unlike a commercial program development operation where a cohesive group spends months building and testing a program against a variety of conditions and hardware, Linux developers are scattered across the globe. There is no formal quality assurance program.

DISADVANTAGES OF USING LINUX

Page 42: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Current applications for such operating systems as Windows 98, MS-DOS and OS/2 more than likely will not work under Linux. Fortunately, those other systems can co-exist with Linux; thus while a user cannot use these operating systems at the same time, a user can leave Linux and boot the other systems to use his or her applications there.

DISADVANTAGES OF USING LINUX

Page 43: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

File System on Linux All user programs, tools,

applications etc. are stored as files on a computer system.

A portion of the disk (secondary storage device) is set aside to store the files and other file related information.

This functional unit is termed a file system.

File system 1

File system 2

File system 3

File system 4

Page 44: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

File System on Linux

The area where files are stored is divided into circular tracks. The circular tracks are further divided into sectors or disk blocks. Each disk block is of the same size Disk block size varies fro system to system. Most systems today have a disk block size of 1 kb (1024 bytes) Disk blocks are categorized into 3 groups

super block group Block containing inodes Block that stores files on the system

The super block is the main block that hold information about the file system.

There can be more than 1 file system on an operating system.

Page 45: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

inode

inodes are data structures that contain information about files in Unix file systems. Each file has an inode and is identified by an inode number (i-number) in the file system where it resides. inodes provide important information on files such as user and group ownership, access mode (read, write, execute permissions) and type.

inodes are created when a file system is created. There are a set number of inodes, which indicates the maximum number of files the system can hold.

A file's inode number can be found using the ls -i command, while the ls -l command will retrieve inode information.

Page 46: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

File System on Linux A typical file system looks like this

FILE

SYSTEM

Super blockSecond block

1024Third block

Page 47: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Text Processing

Linux systems allow powerful ways of processing text. A simple example of text processing is the finding of the

number of occurrences of a pattern given in a text. For instance, given a sentence.

“the pronunciation of the word pronunciation is pronunciation”

We cam find that the pattern “pronunciation” occurs 3 times in the text.

Tools used to perform text processing are grep, egrep and fgrep.

Page 48: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Programming & Documentation

UNIX systems provide programming capability We can perform programming through the shell,

normally referred to as shell programming. Complex system management routines are

typically done through shell programming in Linux.

A shell program can invoke all tools available in the system through easy syntax

Page 49: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

Combined with the power of text processing, programming in UNIX-like system is powerful.

Linux provides us with sound documentation for all its tools.

The documentation can be simply read through a command driven tools called as man.

man is simply a command that provides us with on-line help

man stands for manual pages.

Programming & Documentation

Page 50: Introduction to Linux Instructor: Bennett M. Tanyag UNIT 1

End of UNIT 1