1.1 The Linux System: Design Principles Linux is a multiuser, multitasking system with a full set of UNIX-compatible tools. Its file system adheres to.

Slides:



Advertisements
Similar presentations
POS/420 Philip Robbins – March 19, 2013 (Week 2) University of Phoenix Mililani Campus Introduction to Unix.
Advertisements

Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Chapter One The Essence of UNIX.
1 Introduction to UNIX Ke Liu
CS 497C – Introduction to UNIX Lecture 11: - The File System Chin-Chih Chang
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
1 Unix Systems Administration Y. K. Chang Generic Unix Directory Structure /bin /dev /etc /sbin /home /lost+found / Root Dir /dsk /rdsk /term /pts /rmt.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Linux Linux File System.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
Unix Presentation. What is an Operating System An operating system (OS) is a program that allows you to interact with the computer -- all of the software.
What is Unix Prepared by Dr. Bahjat Qazzaz. What is Unix UNIX is a computer operating system. An operating system is the program that – controls all the.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
1. This presentation covers :  User Interface Administration  Files System and Services Management 2.
File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are.
Guide To UNIX Using Linux Fourth Edition
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
The file structure and related utilities CS240 Computer Science II.
Manage Directories and Files in Linux
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Lesson 1. PC vs. Multi-user System  Personal Computer – each user gets his/her own processor (or multicore processor).  Multi-user system – The processor,
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Unix Basics Chapter 4.
An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: n Date: Jan.29, 2001.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Linux Introduction What is Linux? How do you use it?
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter Two Exploring the UNIX File System and File Security.
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
Linux Commands C151 Multi-User Operating Systems.
The UNIX Time-sharing system
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
Basic UNIX Concepts. Why We Need an Operating System (OS) OS interacts with hardware and manages programs. A safe environment for programs to run is required.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
SUSE Linux Enterprise Desktop Administration Chapter 7 Manage Directories and Files.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 1.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
LINUX Zhengli Zhu, School of Life Sciences. Outline 1. ABC of Linux 2. Basic orers of Linux 3. Bash Programming.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Linux Administration – Finding You Way on the Command Line The Linux File Directory or Tree.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
Linux 101 Training Module Linux Basics.
Welcome to Linux Chap#1 Hanin Abdulrahman.
Linux file system "On a UNIX system, everything is a file;
C151 Multi-User Operating Systems
UNIX Filesystem and Hierarchy
An Introduction to UNIX System --- Cosc513 Presentation
Exploring the UNIX File System and File Security
Unix : Introduction and Commands
Operating Systems Lecture 4.
Chapter 2: The Linux System Part 1
Welcome to Linux Chap#1 Hanin Abdulrahman.
Welcome to Linux Chap#1.
Chapter 4: The Linux Filesystem
Operating System By Prakash G Asnani
Presentation transcript:

1.1 The Linux System: Design Principles Linux is a multiuser, multitasking system with a full set of UNIX-compatible tools. Its file system adheres to traditional UNIX semantics, and it fully implements the standard UNIX networking model. Main design goals are speed, efficiency, flexibility and standardization. Linux is designed to be compliant with the relevant POSIX documents; some Linux distributions have achieved official POSIX certification. The Linux programming interface adheres to the SVR4 UNIX semantics, rather than to BSD behavior.

1.2 The layers of a UNIX system User Interface

1.3 Components of a UNIX System Like most UNIX implementations, Linux is composed of three main bodies of code:  Standard Utilities Programs  Standard Library  Kernel Standard Utilities Programs perform individual specialized management tasks.  Shell  Commands for the management of files and directories  Filters  Compilers  Editors  Commands for the administration of the system  …

1.4 The shell of a UNIX System The UNIX systems have a Graphical User Interface (Linux uses KDE, GNOME …), but the programmers prefer to type the commands. Shell: the user process which executes programs (command interpreter)  User types command  Shell reads command (read from input) and translates it to the operating system. Can run external programs (e.g. netscape ) or internal shell commands (e.g. cd ) Various different shells available:  Bourne shell (sh), C shell (csh), Korn shell (ksh), TC shell (tcsh), Bourne Again shell (bash). The administrator of the system provides to the user a default shell, but the user can change shell.

1.5 The shell of a UNIX System Example of commands  $ cd /usr/src/linux  $ more COPYING  $ cp file1 file2  $ head –20 file  $ head 20 file  $ ls *.c  $ ls [abc]*  $ sort file2 String multiple commands together in a shell script  $ sort file2; head –30 < file2 ; rm temp  $ sort < file | head –30  $ grep org CREDITS | sort | head –20 | tail –5 > file

1.6 The shell is more... The shell is programmable, that is it possible to make the shell scripts A shell script is a file containing a sequence of commands addressed to the operating system that facilitates the repeated execution of the included commands without their having to be laboriously retyped each time they are executed. If there is a distinct ordered list of operating system commands that the user needs to execute repeatedly, for example, immediately after every login or immediately before every logout, then most operating systems have a facility for recording the list of commands in a file, which can then either be executed automatically upon login or logout, or can be invoked by the user through the issuance of a single command that results in the execution of the entire contents of the batch file, which can contain as few as one operating system command or as many as thousands.

1.7 The shell scripts Example:  #!/bin/csh clear echo Menuset stop=1 while ($stop>0) cat << ENDOFMENU 1: stampa data 2: stampa la directory corrente 3: esci ENDOFMENU echo -n Scegli il comando set reply=$< switch ($reply) case 1 :date breaksw case 2 :pwd breaksw case 3 : set stop=0 breaksw default:echo scelta sbagliata riprova breaksw endsw end exit 0

1.8 UNIX Utility Programs A few of the more common UNIX utility programs required by POSIX

1.9 The Standard Library A system call is the method that the user process uses to ask for an action from the O.S. The programs perform the system calls by mean of trap. trap instruction:  changes from user mode to kernel mode  controls the correctness of the call parameters  execution done on behalf of the operating system  returns to user mode Since it is impossible to write a trap in C, it is provided a standard library with a procedure for each system call. These procedures are written in assembler and are called from C. For example a C program for performing the system call read, it calls the procedure read,of the standard library. So, the standard library defines a standard set of functions through which applications interact with the kernel, and which implement much of the operating-system functionality that does not need the full privileges of kernel code. POSIX establishes which are the procedures of the library that the system has to provide, their parameters and tasks.

1.10 The Kernel The kernel is responsible for maintaining the important abstractions of the operating system. It provides the main functions of the abstract machine (system calls and Interrupt and traps). Approximate structure of generic UNIX kernel

1.11 The Kernel The Linux kernel uses a monolithic model. It does not take the “new” client-server model (i.e., micro- kernel). The main reason for this choice is the improvement of the performances.  The kernel code is executed in kernel mode with full access to all the physical resources of the computer.  All kernel code and data are contained in a unique address space. Although the kernel runs as a single process with a single address space, Linux kernel uses the modularity.

1.12 File System Linux files are organized by a hierarchy of labels, commonly known as a directory structure. The files referenced by these labels may be of three kinds:  Regular files, which contains a sequence of bytes that generally corresponds to code (programs) or data.  Directory files, which are stored on disk in a special format and form the backbone of the file system  Special file, which correspond to peripherals such as printers or disks. To the user, Linux file system appears as a hierarchical directory tree obeying UNIX semantics.

1.13 File System / is the root directory; reference point for all directories. Every file has a unambiguous pathname:  /home/user1/papers

1.14 Some directories found in UNIX systems /bin Binaries which are absolutely essential to run Linux. /boot All the files required for booting Linux on a system. /dev All the devices have their corresponding files here. /etc All the configuration files for the various software are stored here. Don't play with this directory. /home All users will have their 'My Documents' under this directory. If your id is rossi, your 'My Documents' (called home-directory) is /home/rossi. /lib The libraries required by system-applications. (Just like DLLs in Windows.) /lost+found When a disk-check finds files which are damaged or which are not linked to any directory, they are recovered to this directory. Such damages are almost always due to incorrect shutdown.

1.15 Some directories found in UNIX systems /mnt The directory where peripherals and other file- systems are mounted. /opt The directory where optional software are installed. /proc proc houses a pseudo-file system. Its contents really do not exist anywhere on the disk, and are made available only when you cd to this directory and look at some file. /root The home-directory for the super-user: root. /sbin The system-administration binaries exist here. /tmp The directory where temporary files are created and stored. All users can save files here. /usr Everything related to users /var Files whose contents vary frequently are in this directory.

1.16 Some directories found in UNIX systems /usr Everything related to users  /usr/bin houses critical binaries of the users  /usr/include The header-files required by programs for compilation.  /usr/lib The libraries required by user-applications.  /usr/local Files peculiar to this particular machine.  /usr/sbin User-administration binaries.  /usr/share Information that can be shared by most users.  /usr/src The source-code for the Linux kernel.  /usr/X11R6 Files needed by the X Window system. /var Files whose contents vary frequently are in this directory.  /var/log The log-files of the system.  /var/spool Directories for mail, news, printing and other queued work.

1.17 Mounting Separate file systems After mounting Before mounting