CEG 333 Introduction To Unix

Slides:



Advertisements
Similar presentations
U NIX C OMP -145 L ECTURE 1: C ONCEPTS OF THE UNIX O PERATING S YSTEM S OURCE : S. D AS, “Y OUR U NIX : T HE ULTIMATE G UIDE ”, 2 ND E DITION, M C G RAW.
Advertisements

CS 497C – Introduction to UNIX Lecture 2: Work with Files and Directories Chin-Chih Chang
Operating Systems - Introduction S H Srinivasan
CS 497C – Introduction to UNIX Lecture 3: Inside UNIX Chin-Chih Chang
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Linux Operating system
The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 145 Operating Systems Introduction to UNIX/Linux.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
Linux Basics CS 302. Outline  What is Unix?  What is Linux?  Virtual Machine.
Chapter 10 – UNIX. History In late 1960s, two employees of Bell Labs (Ken Thompson & Dennis Ritchie) designed a new operating system to overcome the constraints.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
LINUX System : Lecture 3 Vmware, Cygwin, LINUX installation Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University.
Overview of Linux Dr. Michael L. Collard 1.
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
Introduction to Linux ( I ) Sidney Fong 4 th Feb 2006.
UNIX and Shell Programming (06CS36) Unit 1 Continued… Shrinivas R. Mangalwede Department of Computer Science and Engineering K.L.S. Gogte Institute of.
Chapter 1: Welcome to Linux An intro to UNIX-related operating systems.
Unix Background. Introducing Unix Brief Unix History u In 1969, Ken Thompson at AT&T Bell Labs began developing Unix. –First done in assembly language.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. The Operating System Allocates memory for.
LIS508 background of GNU/Linux
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
CS 390 Unix Programming Environment Summer Suchindra Rengan - CS3902 Course Details Instructors Suchindra Rengan – ‘sachin’ ( Section 001)
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Just Enough Unix, Chapter 1
CS2204: Introduction to Unix January 19 th, 2004 Class Meeting 1 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty.
Linux Overview COMS W4118 Spring Slides based on Phil Hutto, Silberschatz 2 History Linux is a modern, free operating system based on UNIX standards.
The UNIX Time-sharing 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.
Introduction to UNIX CS 2204 Class meeting 1 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Introduction to UNIX CS465. What is UNIX? (1) UNIX is an Operating System (OS). An operating system is a control program that allocates the computer's.
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.
CEG 2400 FALL 2012 Linux/UNIX Network Operating Systems.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
INTRO. To I.T Razan N. AlShihabi
By Jonathan Rinfret UNIX/LINUX By Jonathan Rinfret
Overview of Linux Fall 2016 Dr. Donghyun Kim
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
A LECTURE NOTE.
A History of Linux Damian Gordon.
UMBC CMSC 104 – Section 01, Fall 2016
Operating System & Application Software
LINUX WINDOWS Vs..
Selected topic in computer science (1)
Welcome to Linux Chap#1 Hanin Abdulrahman.
COSC 350 System Programming
Introduction to Programming the WWW I
UNIX & LINUX Operating Systems
Lecture 1 Runtime environments.
LINUX WINDOWS Vs..
John Carelli, Instructor Kutztown University
(Chapter 2) John Carelli, Instructor Kutztown University
Chapter 2: System Structures
Unix : Introduction and Commands
Chapter 2: The Linux System Part 1
A short Linux History of UNIX/Linux
Lecture 5: UNIX & LINUX Operating Systems
Linux Professor Sabol.
CSE 303 Concepts and Tools for Software Development
UNIX and Shell Programming (06CS36)
Welcome to Linux Chap#1 Hanin Abdulrahman.
System calls….. C-program->POSIX call
UNIX and Shell Programming (06CS36)
Section 1: Linux Basics and SLES9 Installation
Welcome to Linux Chap#1.
Chapter 1 What is UNIX? Graham Glass and King Ables,
Operating System By Prakash G Asnani
An Introduction to Operating Systems
Presentation transcript:

CEG 333 Introduction To Unix Todd V. Rovito Department of Computer Science and Engineering Wright State University Intro to Unix CEG 333 Week 1

Resources used to make slides Dr. Travis Doom’s lecture notes CEG 333 Fall 2005. http://www.wikipedia.org Textbook: “Your Unix: The ultimate guide” Intro to Unix CEG 333 Week 1

Why Unix? For computer scientists by computer scientists Runs on (nearly) everything Basis for most modern Operating Systems (OS) Required by ABIT accreditation board CS/CEG students should be able to operate both Windows and Unix In preparation for data structures, operating systems Modern day super computers and clusters all operate on some type of Unix Intro to Unix CEG 333 Week 1

Why Linux or Open Source? David Wheeler has the best paper on Linux Market Share/Performance/Reliability. http://www.dwheeler.com/oss_fs_why.html “OSS/FS has significant market share in many markets, is often the most reliable software, and in many cases has the best performance. OSS/FS scales, both in problem size and project size. OSS/FS software often has far better security, perhaps due to the possibility of worldwide review. Total cost of ownership for OSS/FS is often far less than proprietary software, especially as the number of platforms increases. These statements are not merely opinions; these effects can be shown quantitatively, using a wide variety of measures. Intro to Unix CEG 333 Week 1

What is an Operating System? Intro to Unix CEG 333 Week 1

What is an Operating System? Do we want all programs to have access to all instructions? The OS is a program that acts as an intermediary between the application programs and the hardware resources All communication requires hardware resources, thus the OS is also an intermediary between users and applications The purpose of any OS is to provide an environment in which: users can (conveniently) execute programs and access data application programs can (efficiently and fairly) access system resources (processor time, memory, file space, I/O devices, etc.) The OS need not perform any other useful function: it is a control environment (kernel) controls access to all resources All other software is an application program How does the existence of an OS simplify coding an app? Do you trust others to protect your rights and data? Intro to Unix CEG 333 Week 1

History of Unix 1969 (AT&T) Berkeley Unix 3/9/1978 Ken Thomspon and Dennis Ritchie designed a built a small system with an elegant file system, a command interpreter, and set of utilities. To make UNIX portable, they rewrote the entire system in the C language that was invented by Ritchie. Berkeley Unix 3/9/1978 US law prevented AT&T from selling software so they would give UNIX away with no support. BSD Unix (Berkely Software Distribution) was created to fill in holes that AT&T left out: standard editor (vi), C Shell Networking Protocol Software TCP/IP Intro to Unix CEG 333 Week 1

History of Unix UNIX gets Fragmented Sun Microsystems based Solaris on BSD IBM had AIX HP offers HP-UX DEC produced Digital UNIX -> Tru64 Unix And to make things fun we now have GNU/Linux! Intro to Unix CEG 333 Week 1

POSIX and the Single Unix Specification At the time that Ritchie invented C no standards existed. First AT&T created the System V Interface Definition (SVID). Then other organizations such as the X/Open group created a standard Soon people were concerned about the fragmentation of Unix standards Finally the POSIX (portable operating system interface for computer environments) was developed (IEEE). In 2001 X/Open and IEEE joined together to make the Single UNIX Specification Version 3 (SUSV3) which governs most Unix systems. Intro to Unix CEG 333 Week 1

GNU Recursive acronym that stands for “GNU’s Not Unix”. Founded by Richard Stallman in 1984. Intended to be a complete open/free Unix system. free to study the source code, free to modify the behavior of the software, and free to publish their modified versions of the software Contributions include gcc (GNU Compiler Collection) Emacs GPL (General Public License aka copyleft) Intro to Unix CEG 333 Week 1

GNU By the beginning of the 1990s, GNU had produced or collected nearly all of the necessary components of the GNU system Libraries, Compilers, text editors, Unix-like shell Needed the lowest level, the kernel. The GNU project began developing their own kernel, the Hurd, in 1990 (after an abandoned attempt called Trix). Their early plan was to adapt the BSD 4.4-Lite kernel However, due to a lack of cooperation from the Berkeley programmers, Stallman decided instead to use the Mach microkernel, which subsequently proved unexpectedly difficult, and the Hurd's development proceeded slowly. Intro to Unix CEG 333 Week 1

Linux Linus Torvalds as a undergraduate student at University of Helsinki in 1991 released the Linux kernel under the GPL. People would combine GNU bash, GNU gcc, GNU utilities, and Linux to create a complete Unix operating system. Linux was the missing piece for the GNU project. Stallman insists that all Linux operating systems should be called GNU/Linux. Intro to Unix CEG 333 Week 1

Linux Distributions The most popular GNU/Linux flavors include Red Hat, SuSE, Debian, Slackware, and Mandrake. Most distributions are shipped on multiple CD-ROMS and include lots of free software. Development tools C, C++, Java, Interpreters perl, Python, TCL Multimedia software Internet servers (http, ftp, ssh, game) All major computer vendors (except Microsoft) have committed to support Linux. Intro to Unix CEG 333 Week 1

Linux Books and Resources Just for Fun (book) Torvals and Diamond Biography of Linux non-technical The Cathedral & The Bazaar (book and internet) Eric S. Raymond Free Software Free Society: (book) Richard Stallman Linuxquestions.org (internet) forum for linux users Tldp.org (The Linux Documentation Project) (internet) filled with How-To Guides on everything Intro to Unix CEG 333 Week 1

Why do we have operating systems? OS interacts with hardware and manages programs. Programs not expected to know which hardware they will run on. Must be possible to change hardware without changing the programs. Programs can’t manage themselves. OS provides a safe environment for programs to run. Intro to Unix CEG 333 Week 1

How a program runs on a computer OS loads program from disk and allocates memory and CPU. Instructions in program are run on CPU and OS keeps track of last instruction executed. If program needs to access the hardware, OS does the job on its behalf. OS saves the state of the program if program has to leave CPU temporarily. OS cleans up memory and registers after process has completed execution. Intro to Unix CEG 333 Week 1

Getting Started Log in Editing files with vi, emacs, pico Printing ( lpr –Pecs_russ1 <filename> ) man (man <command name>) Warning: EVERYTHING in UNIX is case-sensitive! Exiting: ^D End of data stream; EOF/EOT; exit/logoff ^C Interrupt Logout Leave the system Exit Leave the shell Intro to Unix CEG 333 Week 1

Key Concepts Everything in the system is represented as a file. Work gets done by processes. Workload shared by two separate programs (kernel and shell). Kernel uses system calls to do most of the work. All UNIX systems use the same system calls. C and UNIX Intro to Unix CEG 333 Week 1

UNIX Architecture User Shell which executes the binary: -cp, mv, grep, tar, who, ps Kernel Hardware See page 16 of text for another view of UNIX Architecture Intro to Unix CEG 333 Week 1

UNIX Architecture: The Kernel Program always resides in memory. Has direct access to the hardware. Handles file I/O. Manages processes, memory, and performs all housekeeping. Only one copy shared by all users. Intro to Unix CEG 333 Week 1

UNIX Architecture: The Shell A program or command invoked only when the user logs in. “owned” by user Accepts user input, examines and rebuilds the command line. Makes calls to the kernel for all other functions. At least one shell is invoked by every user, so a system may have several different shells running simultaneously. User has a choice of shells. Interface between the user and the kernel. Intro to Unix CEG 333 Week 1

Structure of a command Command filenames need no specific extensions. Command [-option 1] [argument 1] [-option 2] [argument 2] … e.g. ls –l Command filenames need no specific extensions. A command’s behavior is determined by its arguments and options. Command and arguments must be separated by whitespace. Generally possible to combine multiple options into a single one (like ls -l -u -t == ls -lut) Order of combining is generally not important (like ls -lut == ls -utl) Case sensitive! Intro to Unix CEG 333 Week 1

Types of commands External program on disk which could be: a binary executable (written in C, C++). a script file (like a shell or perl script). Internal command of the shell which could be a builtin (like cd, pwd, etc.) an alias defined by the user that invokes the disk or internal version in a specific manner. Intro to Unix CEG 333 Week 1

UNIX identity The system identifies you by user and group numbers (UID and GID) Automatically translated by the OS Commands of interest id, groups, whoami, pwd Intro to Unix CEG 333 Week 1

Using man Displays documentation of commands, configuration files, system calls and library functions. Organized in a number of sections. Commands are found in Section 1. May need to use section number when entry exists in multiple sections (e.g. man passwd and man -s 5 passwd). man documentation not available for most internal commands of the shell. Use man man first to know how man should be used. Intro to Unix CEG 333 Week 1

Understanding a man page Example: wc Syntax/Synopsis wc [ -c | -m | -C ] [ -lw ] [ file ... ] Most useful information available in SYNOPSIS and DESCRIPTION. When options grouped in [ ] without a |, one or more of them can be used. (-l, -w and -lw are valid.) The | signifies an OR condition. (Only one of -c, -m or -C can be used.) The ... means that multiple occurrences of the preceding item are possible. (wc can be used with multiple files.) EXIT STATUS indicates values returned on error. Intro to Unix CEG 333 Week 1

File display commands Command/Syntax cat [options] file What it will do cat [options] file concatenate (list) a file echo [text string] echo the text string to stdout head [-number] file display the first 10 (or number of) lines of a file more [options] file page through a text file tail [options] file display the last few lines (or parts) of a file Intro to Unix CEG 333 Week 1