Unix/Linux: History and Philosophy

Similar documents
UNIX Kernel. UNIX History

EECS2301. Lab 1 Winter 2016

The Online Unix Manual

CST Algonquin College 2

Overview of Unix / Linux operating systems

Linux for Beginners. Windows users should download putty or bitvise:

Perl and R Scripting for Biologists

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

An Introduction to Unix Power Tools

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

Introduction to Cygwin Operating Environment

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

5/20/2007. Touring Essential Programs

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

CSCI 2132 Software Development. Lecture 2: Introduction to UNIX and Unix-like Operating Systems

CS246 Spring14 Programming Paradigm Notes on Linux

Unix Handouts. Shantanu N Kulkarni

What is UNIX? A Little Bit about UNIX and User Interfaces. Adapted from Practical Unix and Programming Hunter College

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018

System Administration

CISC 220 fall 2011, set 1: Linux basics

Introduction: What is Unix?

5/8/2012. Specifying Instructions to the Shell Chapter 8

Introduction. Let s start with the first set of slides

System Programming. Introduction to Unix

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

Unix Shells and Other Basic Concepts

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

Welcome to Linux. Lecture 1.1

UNIX Concepts COMPSCI 386

Linux & Shell Programming 2014

CSE II-Sem)

UNIX / LINUX - GETTING STARTED

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

CSE-205: Unix and Shell Programming Unit I The UNIX Operating system

CSE 390a Lecture 1. introduction to Linux/Unix environment

Introduction to the Shell

The UNIX operating system is a set of programs that act as a link between the computer and the user.

CPS221 Lecture: Operating System Functions

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

Part I. UNIX Workshop Series: Quick-Start

Shell script. Shell Scripts. A shell script contains a sequence of commands in a text file. Shell is an command language interpreter.

Command-line interpreters

Linux shell scripting intro/review

CPS221 Lecture: Operating System Functions

Introduction to Shell Scripting

(a) About Unix. History

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Underlying computer system = hardware + software

Shells and Shell Programming

Introduction to Linux

COSC UNIX. Textbook. Grading Scheme

Review of Fundamentals. Todd Kelley CST8207 Todd Kelley 1

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

Unix System Architecture, File System, and Shell Commands

CptS 360 (System Programming) Unit 2: Introduction to UNIX and Linux

Chapter 1 - Introduction. September 8, 2016

Introduction To Linux. Rob Thomas - ACRC

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

mywbut.com UNIX Operating System

Review of Fundamentals

Scripting Languages Course 1. Diana Trandabăț

Linux Command Line Interface. December 27, 2017

Introduction to Linux Overview and Some History

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

INTRODUCTION TO LINUX

Examples: Directory pathname: File pathname: /home/username/ics124/assignments/ /home/username/ops224/assignments/assn1.txt

Introduction to Unix: Fundamental Commands

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Chapter 02 Linux Installation and Usage

Systems Programming. The Unix/Linux Operating System

CSCI2467: Systems Programming Concepts

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Today. Review. Unix as an OS case study Intro to Shell Scripting. What is an Operating System? What are its goals? How do we evaluate it?

Introduction to Linux

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

CSE 391 Lecture 1. introduction to Linux/Unix environment

Shells and Shell Programming

Basics of system administration on a Unix system

LINUX OS FUNDAMENTALS FOR THE SQL ADMIN

Bashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009

Unix to Linux. CS 3113 Fall 2018 Dr. Christan Grant

Introduction to Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Creating a Shell or Command Interperter Program CSCI411 Lab

ACS Unix (Winter Term, ) Page 21

Introduction and Overview Getting Started

Shells. A shell is a command line interpreter that is the interface between the user and the OS. The shell:

NASA Lecture 2 (with lab) 2018/03/05 Michael Tsai Kai-Ling Lo

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

UNIT 9 Introduction to Linux and Ubuntu

CSE 391 Lecture 1. introduction to Linux/Unix environment

Unix basics exercise MBV-INFX410

INSE Lab 1 Introduction to UNIX Fall 2017

2. Features of UNIX OS Several features of UNIX have made it popular. Some of them are:

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Transcription:

Unix/Linux: History and Philosophy History and Background Multics project Unix Linux Multiplexed Information and Computing Service Collaborative venture between General Electric, Bell Telephone Labs, and Project MAC of MIT Design started in 1965 and completed in 1972 Goals of Multics Simultaneous computer access to large community of users Ample computation power and data storage Easy data sharing between users, if desired Pun on the name Multics, was originally named UNICS Originated as a research project in the AT&T Bell Labs in 1969 Designed by Ken Thompson to better play the space war game on a PDP-7 computer Designed to be a small and simple operating system Rewritten to run on a PDP-11 machine in 1970 In 1973, Dennis Ritchie and Thompson rewrote the kernel in C, creating the first portable operating system Created by Linux Torvalds to learn operating systems Uses many applications developed by the Gnu project, hence the name Gnu/Linux Why Unix/Linux? Conceptually simple User is presented with many simple utilities, known as tools A tool does only one thing, but does it well Consistent Uniform interface for most of the commands (in the form of pipe-able commands or filters) Similar functions on different objects handled in uniform manner Extendible Files and I/O devices are treated in the same manner Combine simple tools to build complex tools (again, filters) Create custom environments through aliasing and window managers Modular Tailorability to individual preferences is there to make the machine work for the people and not vice versa Most of the applications are not part of the operating system, and hence, can be replaced at will You have a choice of shells and other general purpose programs, and if you do not feel satisfied, you can easily write one of your own choice

History and philosophy of Unix 2 A number of people have contributed to its development, both good and bad; this has also resulted into multiple ways to solve the same problem Pros and cons of Unix/Linux Pros Cons Truly multitasking Trivial to run multiple programs even from a dumb terminal Truly multiuser Even the PC-based Linux can handle multiple users simultaneously while running on a 386 Robust It is rare to see system crashes caused by a user program The memory allocated to a process is private to the process, that is, other programs cannot see the code and data for a given program unless special permission is granted The files that belong to a certain user may not be visible to other users unless permission is granted The superuser has permission to read all files Superuser can be prevented from reading personal files by encrypting the files Excellent programming environment Designed by the hackers, for the hackers A vast repository of development tools is standard on the system Another large repository of tools is available from the Free Software Foundation under the Gnu project (www.gnu.org) Portable There is a version for almost every processor Extensible Easy to add new features New commands can be added at the user level or system level, and integrate seamlessly with the existing commands You can write shellscripts effortlessly to perform sets of commonly repeated commands Easy to maintain Older features can be easily replaced, or superseded In existence for over 40 years Has been constantly refined by a large community of users Has been responsible for countless number of developments in the field of computing, including internet, email, and web browsers Vast amount of literature available on every aspect of the system Well understood to the point where you can get free technical help on the Internet for your problems GUI vs. CUI Working on the computer or working for the computer Designed by the hackers, for the hackers Cryptic commands Unix follows the philosophy that all commands should be two to three letters long You may be able to correlate some commands with words, such as ls with list directory but there are obscure commands such as nm which is used to see the contents of shared library Too many commands, you never finish learning it Too much material to learn Constantly increasing number of additional utilities Multiple commands to do the same thing

History and philosophy of Unix 3 Too many different versions Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. Doug Gwyn Structure of the system Structured as a nut Shell Library functions Hardware Kernel System calls Applications The innermost part of the operating systems is called the kernel Kernel directly interfaces with the hardware of the system Hardware can not be directly manipulated by the user The outermost part of the operating system is called the shell A user interfaces with the shell User is free to select a shell of his/her own choice, from the variety of shells available on the system In between the shell and kernel, there is a large number of utilities that can be classified as development tools and applications The applications and development tools are invoked from the shell and may interact with shell (for user inputs) as well as kernel (for manipulating the hardware) Shell and tools Shell is responsible for establishing all interaction with the user Application programs communicate with the kernel under the control of shell Interprets and executes commands, as well as may provide job control Parses the command line, breaking it into tokens separated by whitespace Any metacharacters are evaluated by shell Treated as just another program

History and philosophy of Unix 4 Every user has a default shell assigned by the system administrator Can be customized to user preferences by startup files Enable history and aliases Major shells are classified as follows: Built-in commands Shell name Author Command Prompt Bourne Shell S.R. Bourne sh $ C Shell Bill Joy csh % tcsh Bill Joy tcsh % Korn Shell David Korn ksh $ bash Brian Fox bash $ An extremely small set of commands, compared to the number of utilities on the system Some of the built-in commands provide a programming language like functionality and are useful in writing shell scripts These commands provide the real functionality in the shell External commands Act just like the built in commands User may not be able to tell the difference Newly added commands become part of the system I/O redirection The I/O devices of concern at this point are the ones used for communication with the computer, e.g., monitor and keyboard Unix does not make a distinction between files and I/O devices In effect, monitor and keyboard can be treated as files Keyboard is an input file Terminal monitor is an output file All devices classified to belong to one of the three standard devices, unless otherwise noted stdin Standard input device (keyboard) stdout Standard output device (monitor) stderr Standard error device (monitor) There is an important distinction between output and error devices that will become clear over time Redirection Sending the output of one program to a file, instead of stdout or stderr Receiving the input to a program from a file instead of stdin Based on operators <, >, <<, >>, as well as pipes and tee File system

History and philosophy of Unix 5 Hierarchy of stored user data files Structured like an inverted tree, with the root at the top and branches growing downwards from it Unix file system may look like that of Windows, except that it is much more sophisticated Manages the files and devices root All devices are part of the file system, in the directory /dev A special directory from which all the other directories branch out Always at the top of the tree Ancestor of every file Directory Files Can be used to uniquely identify a file, even if there is more than one file with the same name A branch in the tree May be spawned off of another directory (parent-child relationship) Current working directory Leaves in the file system tree Collection of bytes with no structure imposed by Unix Files. and.. Regular files All directories and files belong to just a single file system Disks are not special (as in Windows) Unix user need not be concerned about which physical disk his/her files reside on Each disk is mounted to a directory Disks from one computer can be mounted to a directory on a different computer, without the user perceiving this User can move across disks by simply changing directories Protecting files; access control Basic shell commands Command structure Each command in Unix is made of a single word, with no spaces Virtually every command is in all lowercase letters (Unix is case-sensitive) The command may be optionally followed by a set of parameters, called tokens Entering commands Entered at the prompt The format of each command is: <command> [<option(s)>] [<argument(s)>]

History and philosophy of Unix 6 where the items in square brackets are not always required Command may be Name of an internal command (built into shell) Name of a Unix utility Name of a user-defined command Option part of the command Exactly one character long Each option preceded by the character - May be followed by an argument for the option Options with no argument can be grouped after a single - character All options precede the command arguments -- may be used to indicate the end of options Arguments Specific to the command Could be file names Command may result into an error if it is not properly parsed Other command line features The features described in the following table allow for special functions on the command line itself Character Example Comment \ $ cp file1 \ Continuation of a command on next line file2 ; date; who am i Allows specification of more than one command on same line whitespace cp file1 file2 Delimiter to separate arguments cat file less Combine two commands The whitespace is any number of blanks (by pressing space bar) or any number of tabs (tab key) Special key sequences Used to perform certain functions from the shell Return value Key Name Action ˆ? or ˆH erase Backup one space and delete character ˆU kill Erase entire command from command line ˆC intr interrupt/stop a currently executing command and return to prompt ˆZ susp Suspend the currently running command It can later be restarted or killed Every command returns a value to indicate if it executed successfully Typically, return value 0 indicates success Available in bash shell variable $?

History and philosophy of Unix 7 Getting help Acts oddly on nights with full moon. BUGS section for catman from 4.2BSD Unix manual Unix provides an online reference manual Same as the printed reference manual Not tutorial in nature Does not compare favorably with the help manuals on Windows but provides the most comprehensive information, especially as you move from one flavor of Unix to another Divided into sections: Section Description 1 User commands 2 System calls 3 Subroutines 4 Devices (Special files and hardware) 5 File formats and configuration files 6 Games and demos 7 Miscellaneous: characters sets, filesystem types, etc 8 System administration and maintenance l Local n New The command to get help on a given section is man (for manual) You can search the manual pages by using the command apropos or using the option -k with the man command The following two are equivalent man -k directory apropos directory Common convention after man page entries The number in parenthesis after the command refers to the section of the manual where the command is found You can get a one-line description of the command by typing the command whatis or by using the option -f with the man command