17
© Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX CHAPTER ONE – UNIX PHILOSOPHY PHILOSOPHY

© Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

Embed Size (px)

Citation preview

Page 1: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

© Prepared By:Razif Razali 1

TMK 265: UNIX SYSTEMTMK 265: UNIX SYSTEM

CHAPTER ONE – UNIX CHAPTER ONE – UNIX PHILOSOPHYPHILOSOPHY

Page 2: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

OVERVIEWOVERVIEW

– The UNIX Philosophy– Introduction to Unix System– History of Unix– Unix structure

© Prepared By:Razif Razali

2

Page 3: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

The UNIX PhilosophyThe UNIX Philosophy

• In 1994 Mike Gancarz (a member of the team that designed the X In 1994 Mike Gancarz (a member of the team that designed the X Window System), drew on his own experience with Unix, as well as Window System), drew on his own experience with Unix, as well as discussions with fellow programmers and people in other fields who discussions with fellow programmers and people in other fields who depended on Unix, to produce depended on Unix, to produce The UNIX PhilosophyThe UNIX Philosophy which sums it up which sums it up into 9 paramount precepts:into 9 paramount precepts:

– Small is beautiful.

– Make each program do one thing well.

– Build a prototype as soon as possible.

– Choose portability over efficiency.

– Store data in flat text files.

– Use software leverage to your advantage.

– Use shell scripts to increase leverage and portability.

– Avoid captive user interfaces.

– Make every program a filter

© Prepared By:Razif Razali

3

Page 4: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

© Prepared By:Razif Razali

4

INTRODUCTION TO UNIX SYSTEMINTRODUCTION TO UNIX SYSTEM

• What is UNIX? What is 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.

– However, knowledge of UNIX is required for operations which aren't covered by a graphical program, or for when there is no windows interface available, for example, in a telnet session.

Page 5: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

INTRODUCTION TO UNIX SYSTEMINTRODUCTION TO UNIX SYSTEM

• Types of UNIXTypes of UNIX– There are many different versions of UNIX, although they share

common similarities. – The most popular varieties of UNIX are Sun Solaris, GNU/Linux,

and MacOS X. – Here in the School, we use Solaris on our servers and

workstations, and Fedora Core Linux on the servers and desktop PCs.

© Prepared By:Razif Razali

5

Page 6: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

INTRODUCTION TO UNIX SYSTEMINTRODUCTION TO UNIX SYSTEM

• The UNIX operating system is made up of three parts; the kernel, The UNIX operating system is made up of three parts; the kernel, the shell and the programs. the shell and the programs.

• The kernel The kernel – The kernel of UNIX is the hub of the operating system: it allocates

time and memory to programs and handles the filestore 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 myfile (which has the effect of removing the file myfile).

– The shell searches the filestore for the file containing the program rm, and then requests the kernel, through system calls, to execute the program rm on myfile. When the process rm myfile has finished running, the shell then returns the UNIX prompt % to the user, indicating that it is waiting for further commands.

© Prepared By:Razif Razali

6

Page 7: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

INTRODUCTION TO UNIX SYSTEMINTRODUCTION TO UNIX SYSTEM

• The shellThe 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 shell gives the user another prompt (% on our systems).

© Prepared By:Razif Razali

7

Page 8: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

INTRODUCTION TO UNIX SYSTEMINTRODUCTION TO UNIX SYSTEM

– Types of Shell in UNIX environment:• Bourne Shell (sh)• Bourne Again Shell (bash)• Korn Shell (ksh)• C Shell (csh)• Es Shell (es)

© Prepared By:Razif Razali

8

Page 9: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

INTRODUCTION TO UNIX SYSTEMINTRODUCTION TO UNIX SYSTEM

• The adept user can customize his/her own shell, and users can The adept user can customize his/her own shell, and users can use different shells on the same machine. Staff and students in use different shells on the same machine. Staff and students in the school have the tcsh shell by default. the school have the tcsh shell by default.

• The tcsh shell has certain features to help the user inputting The tcsh shell has certain features to help the user inputting commands.commands.

• Filename Completion - By typing part of the name of a Filename Completion - By typing part of the name of a command, filename or directory and pressing the [Tab] key, the command, filename or directory and pressing the [Tab] key, the tcsh shell will complete the rest of the name automatically. tcsh shell will complete the rest of the name automatically.

• History - The shell keeps a list of the commands you have typed History - The shell keeps a list of the commands you have typed in. If you need to repeat a command, use the cursor keys to 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 scroll up and down the list or type history for a list of previous commands. commands.

© Prepared By:Razif Razali

9

Page 10: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

HISTORY OF UNIXHISTORY OF UNIX

• The The origin of Unix of Unix

© Prepared By:Razif Razali

10

Page 11: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

UNIX STRUCTUREUNIX STRUCTURE

• Unix structure will be divided into Unix structure will be divided into – File system– Operating System

© Prepared By:Razif Razali

11

Page 12: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

FILE SYSTEMFILE SYSTEM

• The file system is the part of UNIX that organizes and keeps track The file system is the part of UNIX that organizes and keeps track of data.of data.

• The UNIX file system (UFS) is a file system used by many UNIX The UNIX file system (UFS) is a file system used by many UNIX and Unix-like operating systems. and Unix-like operating systems.

• It is also called the Berkeley Fast File System, the BSD Fast File It is also called the Berkeley Fast File System, the BSD Fast File System or FFS. System or FFS.

• It is a distant descendant of the original file system used by It is a distant descendant of the original file system used by Version 7 Unix.Version 7 Unix.

• File System in UNIX in UNIX

© Prepared By:Razif Razali

12

Page 13: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

OPERATING SYSTEMOPERATING SYSTEM

• UNIX is a UNIX is a layeredlayered operating system. The innermost layer is the operating system. The innermost layer is the hardware that provides the services for the OS. hardware that provides the services for the OS.

• The operating system, referred to in UNIX as the kernel, interacts The operating system, referred to in UNIX as the kernel, interacts directly with the hardware and provides the services to the user directly with the hardware and provides the services to the user programs. programs.

• These user programs don't need to know anything about the These user programs don't need to know anything about the hardware. They just need to know how to interact with the kernel hardware. They just need to know how to interact with the kernel and it's up to the kernel to provide the desired service. and it's up to the kernel to provide the desired service.

• Operating System

© Prepared By:Razif Razali

13

Page 14: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

Why Use Unix?Why Use Unix?

• One of the biggest reasons for using Unix is networking One of the biggest reasons for using Unix is networking capability. With other operating systems, additional software must capability. With other operating systems, additional software must be purchased for networking. With Unix, networking capability is be purchased for networking. With Unix, networking capability is simply part of the operating system. Unix is ideal for such things simply part of the operating system. Unix is ideal for such things as world wide e-mail and connecting to the Internet. as world wide e-mail and connecting to the Internet.

• Unix was founded on what could be called a "small is good" Unix was founded on what could be called a "small is good" philosophy. The idea is that each program is designed to do one philosophy. The idea is that each program is designed to do one job well. Because Unix was developed by different people with job well. Because Unix was developed by different people with different needs it has grown to an operating system that is both different needs it has grown to an operating system that is both flexible and easy to adapt for specific needs. flexible and easy to adapt for specific needs.

• Unix was written in a machine independent language. So Unix and Unix was written in a machine independent language. So Unix and unix-like operating systems can run on a variety of hardware. unix-like operating systems can run on a variety of hardware.

© Prepared By:Razif Razali

14

Page 15: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

Advantages of UNIXAdvantages of UNIX

• It is It is multitaskingmultitasking, therefore, multiple programs can run at one time. , therefore, multiple programs can run at one time. • It is It is multiusermultiuser, allowing more than a single user to work at any , allowing more than a single user to work at any

given time. This is accomplished by sharing processing time given time. This is accomplished by sharing processing time between each user and utilizing distributed computing systems. between each user and utilizing distributed computing systems.

• It is It is safesafe, preventing one program from accessing memory or , preventing one program from accessing memory or storage space allocated to another, and enables protection, storage space allocated to another, and enables protection, requiring users to have permission to perform certain functions, requiring users to have permission to perform certain functions, i.e. accessing a directory, file, or disk drive.i.e. accessing a directory, file, or disk drive.

© Prepared By:Razif Razali

15

Page 16: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

Disadvantages of UNIXDisadvantages of UNIX

• The traditional The traditional command line command line shell interface is user hostile -- shell interface is user hostile -- designed for the programmer, not the casual user. designed for the programmer, not the casual user.

• Commands often have Commands often have cryptic names cryptic names and give very little response and give very little response to tell the user what they are doing. to tell the user what they are doing.

• To use Unix well, you need to understand some of the main design To use Unix well, you need to understand some of the main design features. features.

• Richness of utilities Richness of utilities (over 400 standard ones) often overwhelms (over 400 standard ones) often overwhelms novices.novices.

• Documentation is short Documentation is short on examples and tutorials to help you on examples and tutorials to help you figure out how to figure out how to useuse the many tools provided to accomplish the many tools provided to accomplish various kinds of tasks. various kinds of tasks.

© Prepared By:Razif Razali

16

Page 17: © Prepared By: Razif Razali 1 TMK 265: UNIX SYSTEM CHAPTER ONE – UNIX PHILOSOPHY

CONCLUSIONCONCLUSION

• The UNIX philosophyThe UNIX philosophy• UNIX historyUNIX history• UNIX StructureUNIX Structure• Advantages of using UNIXAdvantages of using UNIX• Disadvantages of using UNIXDisadvantages of using UNIX

© Prepared By:Razif Razali

17