Top Banner
An Introduction to UNIX System --- Cosc513 Presentation Instructor: Morteza Anvari Author: Yonghong Pan ID#: 105107 Date: Jan.29, 2001
26

An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Dec 29, 2015

Download

Documents

Ami Pearson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

An Introduction to UNIX System

--- Cosc513 Presentation

Instructor: Morteza Anvari Author: Yonghong Pan

ID#: 105107 Date: Jan.29, 2001

Page 2: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

What is an Operating System?

In today’ market, every computer has an operating system.

Operating systems is a program that controls all the other parts of a computer system - both the hardware and the software.

Operating system allows us to make use of the facilities provided by the system.

Page 3: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

UNIX:

Unix is one kind of the operating systems. The UNIX operating system has three

important features: the kernel, the shell and Unix file system.

Page 4: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.
Page 5: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Kernel:

The kernel is at the core of each UNIX system and is loaded in whenever the system is started up - referred to as a boot of the system.

Page 6: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Function of Kernel

The most important functions of 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. organizing 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.

Page 7: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

How to locate the kernel file?

Usually, the root directory contains both the boot program and the file containing the kernel for the system. The name of the kernel file varies , but will usually include the letters “nix” so you can search for it with wildcard characters.

For example: ls /*nix* -rwxr----- 1 root 1987654 Sep 24 2000 /dump

Page 8: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Shell:

Shell is the program whenever you login to a Unix system . You will see command prompt at the bottom left of your screen after you login.

The shell acts as a command interpreter; it takes each command you enter and passes it to the operating system kernel to be acted upon. Finally, it displays the results of this operation on your screen.

Page 9: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Feathers of Shell:

With shell you can: Create an environment that meets your needs . Write shell scripts. Define command aliases. Manipulate the command history. Automatically complete the command line. Edit the command line.

Page 10: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Different types of Shell:

There are several different types of shell. The following are most popular ones:

bourne shell (sh); (First release in 1978)

c shell (csh); (First release in 1977)

TC shell (tcsh); Korn shell (ksh); bourne Again shell (bash);

Page 11: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

UNIX File System:

The file is the smallest unit in which information is stored.

A file system is a logical method for organizing and storing large amounts of information in a way which makes it easy manage.

Page 12: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Feathers of Unix File System:

The Unix File System has the following important feathers:

1)different types of file; 2)structure of the file system; 3)your home directory; 4)your current directory; 5)pathnames; 6)access permissions;

Page 13: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Different types of file

As a user, it seems to you there is only one type of file in Unix which hold your information. In fact there is several different types of file:1)Ordinary files; 2)Directories;

3)Special files;4)Pipes;

Page 14: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Ordinary Files

This is type of file you usually work with. It is used to store your information, such as text file you edit or the image you draw.

Page 15: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Special Files

This type of file is used to display physical devices such as printers, tape drives, terminals, etc.

Usually, directory /dev contains the special files which are used to represent devices on a UNIX system.

Directory /dev/null is the special place to which you can redirect unwanted output.

Page 16: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Pipes

Unix allows you to link multiple commands together by using a pipe.

The pipe takes the standard output from one command and uses it as the standard input to another command. command1 | command2 | command3

Pipes act a temporary file which only exist to hold data from one command until it is read by another.

Page 17: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Structure of Unix File System

The UNIX file system is organized as a hierarchy of directories starting from a single directory called root which is represented by a / (slash).

Immediately below the root directory are several system directories that contain information required by the operating system.

Page 18: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Unix System Directories

The standard system directories are shown as diagram on the next slide. Each one contains specific types of file. The details may vary between different Unix systems, but these directories should be common to all.

Page 19: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Unix System Directories

/b in /d ev /e tc /h om e /lib /tm p

ip an d sm ith

/u s r ke rn e l f iles

/ (ro o t)

Page 20: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Home Directory

Unix home directory is the place whenever you log on to Unix system.

User's home directories are usually grouped together under a system directory such as /home. Each different user has his own subdirectory of /home.

Page 21: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Current Directory

As we know by the name, current directory is the directory where you are currently in.

When the first time you logon to Unix system, home directory is your current directory.

Page 22: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Pathnames

Every file and directory in the file system can be identified by a complete list of the directories’ name from the root directory to that file or directory.

Each directory name on the route is separated by a forward slash ( / ).

eg. /home/dsmith/working/

Page 23: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Access Permissions

You can change files and directories permissions to allow other user to access your files or directories if you want by using command:

chmod mode [filename|directory_name] You can display access permissions by using

command: ls -l

[filename|directory_name] -rwx------ 1 ipan devlop 7204 Jan 19 11:49 bcp.sql -rwx------ 1 ipan devlop 3392 Jan 17 11:47 bcp_master.sql drwxrwxr-x 2 ipan devlop 512 Jan 2 15:41 bin

Page 24: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Summary

Unix consider any physical device attached to it to be a file.

Files are organized in a tree-structure directories.

Files and Directories can be protected by setting access permissions.

Page 25: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

Reference:

http://www.geek-girl.com/Unixhelp/ Unix Power Tools, Author: Jerry Peek

Page 26: An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: 105107 n Date: Jan.29, 2001.

The End