1 Unix basics. Part 1

Post on 25-Dec-2014

477 views 1 download

description

History, terminology, FSH and FS navigation commands.

transcript

System Software

Roman Prykhodchenkorprikhodchenko@kture.kharkov.ua

Unix basics

Tuesday, February 8, 2011

Agenda

• History

• Terminology

• Unix commons

Tuesday, February 8, 2011

History

Tuesday, February 8, 2011

UNIX

• UNIX is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.

• Today UNIX is a family of the operating systems that correspond to the Single Unix Specification.

Tuesday, February 8, 2011

Main events

• 1969 – MULTICS, the first implementation of the UNIX operating system for General Electric GE-645 computer.

• 1976 – UNIX Timesharing System 6

• 1977 – Berkley Software Distribution (BSD)

• 1979 – UNIX Timesharing System 7

• 1982 – BSD 4.1 implements TCP/IP

Tuesday, February 8, 2011

PeopleDenis Ritchie Brian Kernighan Ken Thompson

Tuesday, February 8, 2011

Main events

• 1988 – First edition of POSIX standard

• 1989 – The ANSI C standard is published

• 1983 – Richard Stallman initiated the GNU project

• 1992 – The GNU is using the Linux kernel

• 1994 – 386 BSD is released

Tuesday, February 8, 2011

PeopleLinus Torvalds Richard Stallman

Tuesday, February 8, 2011

People

William Jolitz Lynne Jolitz

Tuesday, February 8, 2011

Terminology

Tuesday, February 8, 2011

*nix

• UNIX-like operating system (or just *nix) is an operating system that behaves similar to UNIX but does not correspond to the Single Unix Specification.

Tuesday, February 8, 2011

SUS

• Single UNIX specification is the collective name of a family of standards for computer operating systems to qualify for the name "Unix"

Tuesday, February 8, 2011

POSIX

• POSIX (Portable Operating System Interface for uniX)is the standard for the UNIX operating system published by IEEE Computer Society.

• Includes:

• System API

• Shell interface

• API of the system utilities

Tuesday, February 8, 2011

Time-sharing

• Time-sharing operating system shares a computing resource among many users by means of multiprogramming and multi-tasking.

Tuesday, February 8, 2011

Unix commons

Tuesday, February 8, 2011

Key properties

• Portability

• Preemptive multitasking

• Virtual memory

• Multilevel architecture

• Support of asynchronous processes

• Device-independent I/O

Tuesday, February 8, 2011

Software conception

• Do only one thing and do it well.For each task the system can perform there is a separate program.

• Examples:cp – copies a filecat – prints a file’s contents

• Benefits:- Simplicity- Number of errors is relatively small.

Tuesday, February 8, 2011

Everything is a file

• Every computer’s resource is represented by a file.

• Examples:/home/john/text.txt – John’s text file/dev/sda – first hard drive/proc/scsi – information about any devices connected via a SCSI or RAID controller

• Benefits:Device-independent I/O operations.

Tuesday, February 8, 2011

Multilevel architecture

• Each software type runs on an appropriate level

• Memory is not shared between different levels

• System calls for inter-level communications

Tuesday, February 8, 2011

Multilevel architecture

Application software, network services, utilities

System software (command interpreters, protocols...)

System calls

Kernel

Tuesday, February 8, 2011

Kernel

• Scheduling

• Memory management

• Interruptions processing

• Inter-process communication

• Low-level device support

Tuesday, February 8, 2011

Kernel

• Monolithic kernel

• Microkernel

• Nanokernel

• Exokernel

• Hybrid kernel

Tuesday, February 8, 2011

Kernel

Tuesday, February 8, 2011

Kernel“Exokernel”

based Operating System

Tuesday, February 8, 2011

System calls

• Process management

• Implementation of I/O operations

• Bind user actions to drivers

Tuesday, February 8, 2011

Signals

• Signals are an approach of inter-process communication (IPC)

• Signal is an asynchronous message sent to signal

• Operating system interrupts the process when it is sent a signal

Tuesday, February 8, 2011

Signals

• A process can implement a handler for different kind of signals

• Default handler kills the process

• Some signals can not be handled

Tuesday, February 8, 2011

Signals

• Sources of signals:

• Keyboard shortcuts

• Kernel

• Hardware exception

• Wrong system call

• I/O operations

• A process

Tuesday, February 8, 2011

ShellShell is a command-line interpreter that provides a traditional user interface for the Unix operating system and for Unix-like systems.

Most popular are: bash, sh, csh, zsh

We will mostly use bash.

Tuesday, February 8, 2011

Common syntax$ app_name [options] [parameters]

Options begin with - or --

-o1 [value] -o2 -o3 [value]

or-o1o2o3

Examples:$ tar -x -j -v -f archive.tar.gz$ tar -xjvf archive.tar.gz

Parameters are usually required.$ rdesktop -f -u UserName 192.168.0.124

Tuesday, February 8, 2011

Manual pagesMan application shows a manual page for specified application:

$ man {app_name}

Or you can use option -h to see a short help:$ tar -h

Tuesday, February 8, 2011

File system hierarchy standard/ Rood directory

/bin/ Essential command binaries

/boot/ Static bootloader

/dev/ Devices represented by files

/etc/ Host-specific configuration data

/lib/ Basic shared libraries and kernel modules

/mnt/ Temporary mount point

/opt/ Optional software

/sbin/ Basic system software

/tmp/ Temporary data

/usr/ Secondary hierarchy

/var/ Variable data

Tuesday, February 8, 2011

PATHPATH is an environment variable used by shells for searching for applications.

Applications located in directories that are included to PATH can be launched without specifying full path.

$ echo $PATH/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin

You can modify PATH$ PATH=$PATH:~/bin

Tuesday, February 8, 2011

Navigationcd Navigates to specified directory

ls Shows current directory’s contents

pwd Shows current directory

mkdir Creates a directory

rmdir Removes a directory

touch Modifies last change date

rm Deletes a file

Tuesday, February 8, 2011

InodesInode is an index descriptor of a filesystem resource.

- Every resource has own inode number.- File name is a link to inode.

Example:$ ls -dl /usr/localdrwxr-xr-x 8 root root 240 Dec 22

/usr/local/usr/local/./usr/local/bin/../usr/local/games/../usr/local/lib/../usr/local/sbin/../usr/local/share/../usr/local/src/..

Tuesday, February 8, 2011

Questions?

Tuesday, February 8, 2011