UNIX Introduction. Computer Center, CS, NCTU 2 UNIX History  Before Multics there was chaos, and afterwards, too Multics:  Multiplexed information and.

Slides:



Advertisements
Similar presentations
Lesson 10-Controlling User Processes. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
Advertisements

1 Introduction to UNIX Ke Liu
Exploring the UNIX File System and File Security
UNIX Introduction. Computer Center, CS, NCTU 2 UNIX History (1)  Before Multics there was chaos, and afterwards, too Multics:  Multiplexed information.
Operating Systems Review. User Computer, including HW and SW.
Operating Systems - Introduction S H Srinivasan
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
1 Basics of Linux On linux machine: Login at your home directory Open a “shell” or “terminal” or “xterm” workspace (4) On windows machine Intall linux.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
Systems Programming Concepts
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
System Administration. Computer Center, CS, NCTU 2 What System Administrator Should do? (1)  Ordinary list Install new system, programs and OS updates.
Lesson 1. PC vs. Multi-user System  Personal Computer – each user gets his/her own processor (or multicore processor).  Multi-user system – The processor,
Unix Basics Chapter 4.
Operating systém GNU Linux. History First computers –WW II The Bomb (Alan Turing) Colosus (Thomas Flowers)
Linux overview. Architecture Kernel File system Shell: Korn, Bourne, C, Bash X Windows: Motif, Open Look, X.OrgX.Org Desktop: Gnome, KDE,etc.
FreeBSD huanghs. Computer Center, CS, NCTU 2 Outline  FreeBSD version 9.0-RELEASE 9.1-RC1  Installing FreeBSD From CD-ROM From USB.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Chapter Eight Exploring the UNIX Utilities. 2 Lesson A Using the UNIX Utilities.
Natawut NupairojAssembly Language1 Unix Survival Guide.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
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.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
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.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
UNIX File System by Tero Toikkanen, CAP02S. UNIX Multi-user system Multi-user system Multi-tasking system Multi-tasking system Wide selection of tools.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
UNIX System Protection. Unix History Developed by Dennis Ritchie and Ken Thompson at AT&T Bell Labs Adapted some ideas from the Multics project in 1969.
Lab 3 + Using the Terminal 1. "Under Linux there are GUIs (graphical user interfaces). where you can point and click and drag, and hopefully get work.
UNIX History - joint venture between MIT and Bell Labs (originally called Multics) – Ken Thompson (AT&T) created an operating system to run Space.
 Before Multics there was chaos, and afterwards, too › Multics:  Multiplexed information and Computing Service  1965 ~ 1969  Bell labs, GE, MIT 
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Linux Commands C151 Multi-User Operating Systems.
Introduction 1 Chapter 1. Introduction History and Proliferation Mandate for Change What’s Good and Wrong Scope of this course.
The Unix File system (UFS) Presented by: Gurpreet Singh Assistant Professor Department of School of Computing and Engineering Galgotias University.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Introduction to UNIX CS 2204 Class meeting 1 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
Chapter 6 Adding New Users. Computer Center, CS, NCTU 2 Steps to add a new user 1.Edit the password and group files >vipw, pw 2.Set an initial password.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
File System. Computer Center, CS, NCTU 2 Files  % ls – l d rwx--x--x 7 liuyh gcs 1024 Sep 22 17:25 public_html File type File access mode # of inodes.
Chapter Eight Exploring the UNIX Utilities. 2 Lesson A Using the UNIX Utilities.
WHY AN OPERATING SYSTEM (OS) OS interacts with hardware and manages programs. Programs not expected to know which hardware they will run on. Must be possible.
Comp 145 – Introduction to UNIX $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 $200 $400 $600 $800 $1000 Basic Concepts.
Chapter 5 The Filesystem. Computer Center, CS, NCTU 2 Outline  File System Architecture  Pathname  File Tree  Mounting  File Types  inode and file.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Operating Systems Introduction Moti Geva
Overview of Linux Fall 2016 Dr. Donghyun Kim
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
UNIX Introduction History Main Features UNIX Operating System
Introduction.
Tools of Web Development 1: Module C: Using Unix
The Linux Operating System
Unix Operating System (Week Two)
Unix : Introduction and Commands
UNIX System Protection
UNIX Introduction.
Computer System Administration
System Administration Practice
UNIX and Shell Programming (06CS36)
UNIX and Shell Programming (06CS36)
Section 1: Linux Basics and SLES9 Installation
The UNIX Time Sharing System
Presentation transcript:

UNIX Introduction

Computer Center, CS, NCTU 2 UNIX History  Before Multics there was chaos, and afterwards, too Multics:  Multiplexed information and Computing Service  1965 ~ 1969  Bell labs, GE, MIT  Ken Thompson, Dennis Ritchie  In 1970, Brian Kernighan suggested the name “UNIX”.

Computer Center, CS, NCTU 3 UNIX genealogy  AT&T Version 7~10 System III ~ V  UCB BSD  IBM 、 DEC 、 HP OSF/1

Computer Center, CS, NCTU 4 BSD

5 Further Reading    n n  

Computer Center, CS, NCTU 6 Conventions  Syntax of commands: Anything between “[” & “]” – are optional. Anything followed by “…” – can be repeated. {a | b} – you should choose one of them. Example:  bork [-x] { on | off } filename … bork on /etc/hosts ○ bork –x off /etc/hosts /etc/passwd ○ bork –x /etc/hosts X bork -h /etc/hosts X  Globing characters “*” matches zero or more characters. “?” match one character. “~” (twiddle) means home directory “~user” means home directory of user

Computer Center, CS, NCTU 7 man pages (manual)  man pages (manual) Contain descriptions of  Individual command. –% man cp  File format. –% man rc.local  Library routines. –% man strcpy

Computer Center, CS, NCTU 8 man command  Command % man [-s section] title(AT&T) % man [section] title (BSD)  % man printf(printf command)  % man 3 printf (C Standard printf func.)  % man –k exit(keyword search)  Man pages organization AT&TBSDContents 11 User-Level commands and applications 22 System calls and kernel error code 33 Library calls 45 Standard file format 57 Miscellaneous files and documents 66 Games and demonstrations 74 Device Drivers and network protocols 1m8 System administration commands 99 Obscure kernel specs and interfaces %man man

Computer Center, CS, NCTU 9 UNIX Concepts - ID  User ID, Group ID % id liuyh  uid=10047(liuyh) gid=300(gcs) groups=300(gcs),0(wheel),800(security),700(ta),888(wwwadm) % id  uid=10047(liuyh) gid=300(gcs) groups=300(gcs),0(wheel),800(security),700(ta),888(wwwadm)  Super user root  uid=0(root) gid=0(wheel) groups=0(wheel), …  Other Important Users daemon: owner of unprivileged software bin: owner of system commands sys: owner of the kernel and memory images nobody: owner of nothing

Computer Center, CS, NCTU 10 UNIX Concepts - Files  % ls – l d rwx--x--x 12 liuyh gcs 1024 Sep 22 17:25 public_html/ File type File access mode # of inodes File user owner File group owner File size File last modify time File name

Computer Center, CS, NCTU 11 UNIX Concepts - File types  File types  file command determine file type  % file.tcshrc .tcshrc: ASCII text  % file /bin  /bin: directory  % file /bin/sh  /bin/sh: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), stripped /usr/ports/sysutils/file symbolFile types bBlock device file cCharacter device file dDirectory lsymbolic Link sSocket pnamed Pipe -Regular file

Computer Center, CS, NCTU 12 UNIX Concepts - File Access Mode  rwx r-x r-x User, group, other privileges  chmod command % chmod access-string file  % chmod u+x test.sh  % chmod go-w.tcshrc  % chmod u+w,r-w hehe haha  % chmod – R 755 public_html/

Computer Center, CS, NCTU 13 UNIX Concepts - File Protection Command Minimum Access Needed On file itselfOn directory file is in cd /home/testx ls /home/test/*.cr ls – s /home/test/*.c rx cat runmerx cat >> runmewx run-binaryxx run-scriptrxx rm rummewx

Computer Center, CS, NCTU 14 UNIX Concepts - Process  Process: A working program foreground  remain attached to the terminal background  can not communicate with terminal nohup 、 screen  Process Life Cycle fork, exec

Computer Center, CS, NCTU 15 UNIX Concepts - Watching Process  ps command ps –aux, ps –auxww  USER, PID, %CPU, %MEM, VSZ RSS, TTY, STAT, START, TIME, COMMAND –D: in Disk –I: Idle –R: Running –S: Sleeping –T: sTopped –Z: Zombie –man ps … USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND root ?? WLs 30Jul06 0:00.01 [swapper] Liuyh p4 R+ 2:30PM 0:00.00 ps auxww

Computer Center, CS, NCTU 16 UNIX Concepts - Kill Process  kill command % kill –[signal_name] pid % kill –[signal_number] pid  % kill – HUP 88192(hang up, reset)  % kill  % kill – TERM 12345(software termination)  % kill –  % kill – KILL 3456(kill program at OS level)  % kill killall: powerful and useful, and carefully use it.