UNIX - Introduction

UNIX - Introduction UNIX an Operating System Master Control Program UNIX a name of a culture UNIX a set of tools for smart people UNIX easy to use, difficult to learn Other Operating Systems MVS for IBM mainframes VMS for Digital mainframes DOS or Windows for IBM-PCs UNIX for a wide range of hardware from PCs to mainframes

AIX from IBM HP-UX from HP SUNOS, SOLARIS from Sun ULTRIX from Digital A/UX from Apple Minix from Tanenbaum, LINUX POSIX from IEEE Standard Group 1003 History of UNIX MULTICS Multiplexed Information and Computing Services Operating system for a GE 645 to serve all of Boston in mid 60s. Cooperative effort by GE, Honeywell, NCR, Bell Labs and universities

UNICS Uniplexed Information and Computing Services Ken Thompson, Bell Labs (Late 60s) Personal effort for a PDP-7 (64 KB), later for a PDP-11 Uses language B, which was derived from BCPL by Martin Richards In 1973 Ken Thomson and Dennis Ritchie develop typed language C The C Programming Language, Reference Manual 1978 ANSI C, starting 1983 UNIX Name copyright of AT&T. UNIX sold to universities at minimal cost Universities dissect UNIX and train new users Computer Systems Research Group at Berkley:

Supported by DARPA, make significant changes to UNIX and distribute it as Berkley Software Distribution 1 BSD for PDP-11 2 BSD 3 BSD 4.1 to 4.4 BSD provides support for virtual memory, networking, TCP/IP Most popular version 4.32 BSD. Computer System Research Group dissolved in 1993, due to cut in funding. Versions of UNIX after AT&T was broken up and allowed to sell software: UNIX System III Multiuser (not successful) UNIX System V developed with Sun Micro System UNIX System V, Release 4 SVR4 and 4.3 BSD not compatible

AT&T issues SVID (System V Interface Definition) to keep vendors in line, BSD camp ignores it. Recent history UNIX System Laboratories (USL) set up by AT&T IEEE Standard Board tries to mend rift between SVR4 and 4.3 BSD by creating POSIX (Portable Operating System) New rift between AT&T and IBM IBM, DEC, HP and others set up Open Software Foundation Accept IEEE standards, but add additional ones for Windowing systems, X11 from MIT Graphical interface, Motiv Distributed computing etc. 1993 AT&T sells USL to NOVELL 1995 UNIX sold to Santa Cruz Operations Inc. and HP The keyboard and ASCII b6b5b4b3b2b1b0 b6b5 = 00 control code = 01 special character or digit

= 10 upper case = 11 lower case Control Codes: CC Communication Control FE Format Effector IS Information Separator ASCII character matrix Least significant 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011

1100 1101 1110 1111 000 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SOH

SI 001 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US Most significant bits (6, 5, 4 )

010 011 100 101 SP 0 @ P ! 1 A Q " 2 B R # 3 C S $

4 D T % 5 E U & 6 F V ' 7 G W ( 8 H X ) 9

I Y * : J Z + ; K [ , < L \ = M ] . > N ^

/ ? O _ 110 ` a b c d e f g h I j k l m n

o 111 p q r s t u v w x y z { | } ~ DEL Number

Keys 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ^@

^A ^B ^C ^D ^E ^F ^G ^H ^I ^J ^K ^L ^M ^N ^O Control NUL SOH STX ETX

EOT ENQ ACK BEL BS HT LF VT FF CR SO SI Description Start Of Heading Start Of Text End Of Text End Of Transmission Enquiry Acknowledge Bell

Backspace Horizontal Tab Line Feed Vertical Tab Form Feed Carriage Return Shift Out graphic set Shift In graphic set Category CC CC CC CC CC CC CC FE FE FE FE

FE FE Number Keys Control 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 127

^P ^Q ^R ^S ^T ^U ^V ^W ^X ^Y ^Z ^[ ^\ ^] ^^ ^_ DLE DC1 DC2

DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US DEL Description Category Data Link Escape Device Control 1

Device Control 2 Device Control 3 Device Control 4 Negative Acknowledge Synchronize Idle End of Transmission Block Cancel End of Medium Substitute Escape File Separator Group Separator Record Separator Unit Separator Delete CC CC CC CC

IS IS IS IS Control Codes Used by UNIX Unix Code intr eof erase werase

kill stop start Usual Key ^C ^D ^H ^W ^U ^S ^Q Purpose Stop running program no more data erase last character erase last word erase entire line stop output to screen start output to screen

Setting of keys stty a gives listing of key settings stty erase ^H either hold down control key or type 2 characters: ^ and H stty kill k will kill input line on typing k not a good idea! stty intr ^? Interrupt assigned to escape key Carriage return ^M and linefeed ^J UNIX stores single linefeed ^J in file to indicate end of line DOS stores carriage return and linefeed ^M^J in file to indicate end of line Return key generates ^M Example of UNIX and DOS files This is a

test Internal representation In UNIX 15 bytes 54 68 69 73 0A 69 73 0A 61 0A 54 65 73 74 0A In DOS 19 bytes 54 68 69 73 0D 0A 69 73 0D 0A 61 0D 0A 54 65 73 74 0D 0A DOS file in a UNIX editor This^M is^M a^M Test^M UNIX file displayed under DOS This is a Test

Translation on Input and Output UNIX wants to treat input from terminal and from a file the same When file was created ^M was translated into ^J On output UNIX translates ^J into ^M^J Entering Commands % who am I Return, Enter or ^M Until is pressed command can be edited with ^H, ^W, ^U When UNIX receives ^M it translates it into ^J and UNIX starts executing command Input is echoed to screen with ^J translated to ^M^J Login and Logout commands login userid - initiates new login ^D logs out when given a command to login shell

logout passwd changes your password File-Related Commands cat file cp file1 file3 cp file dir more file mv file1 file2 mv file dir rm file Directory-Related Commands

cd dir pwd mkdir dir rmdir dir ls op [file ] Informational Commands date

finger name look prefix man cmd who w Permission settings - chmod -rwxrwxrwx Position 1 is file type Positions 2,3,4 are permissions of u (user) Positions 5,6,7 are permissions of g (group) Positions 8,9,10 are permissions of o (other) % ls l hmk -rwx--x--x 1 bermanka faculty 129 Jul 24 14:11 hmk % chmod a+r hmk % ls -l hmk -rwxr-xr-x 1 bermanka faculty 129 Jul 24 14:11 hmk Standard Files stdin stdout

stderr Standard input (default keyboard) Standard output (default screen) Standard error messages (screen) Definition of Filter A program or command is called a filter if it uses standard input and standard output. Most trivial example: cat sends stdin to stdout Other examples: cut, less, more, Not a filter: ls, w, who, Redirection of Input and Output < filename take standard input from that file > filename

send standard output to filename Examples: ls > myfiles more < myfiles cat < myfiles >myfilestoo Redirection of stdout can destroy existing files! Use set noclobber to prevent accidental overwriting If you want to overwrite an existing file ls >! names >> will append to an existing file Redirection of stdin sort < file1 same as sort file1 but sort file1 file2 has a different meaning it will merge the files. mail alex < memo Will send file memo to user alex List of useful filters cat copy standard input to output colrm remove specific columns crypt encode or decode with a key cut extract selected columns or fields fmtformat to fit 72 characters per line grep extract lines with a specific pattern head extract first few lines of a file

Useful filters continued less display file similar to more more display file nl create line numbers paste combine columns of data pg display file similar to more rev reverse order of characters sort sort or merge data spell

check spelling of words Useful filters continued tail tr uniq wc tee extract lines at end of file translate selected characters look for repeated lines count number of lines, words or characters duplicates standard input

The UNIX pipe ls | more Same as ls > temp more < temp rm temp Using the tee utility % who | tee who.txt | grep berman Shell scripts File containing sequence of UNIX commands Created in vi or emacs: #!/bin/csh echo My name is Kenneth Berman echo My user name is $user

Recently Viewed Presentations

  • 幻灯片 1 - Shandong University

    幻灯片 1 - Shandong University

    第十一章 微生物产能代谢 第一节 微生物糖解途径 一、emp途径 二、hmp途径 三、ed途径 四、pk途径 五、hk途径 苯 儿茶酚 oh oh 儿茶酚 cooh nh oh 苯酚 二联苯 nh r 色氨酸 cooh 苯甲酸 烷基 烷基苯 choh-cooh 扁桃酸 ch2chnh2-cooh 苯丙氨酸 cooh oh 奈 水杨酸 蒽 芳香化合物降解为儿茶酚 苯甲酸 oh cooh oh...
  • August 8th Town Hall  Welcome to the August

    August 8th Town Hall Welcome to the August

    SPED Groups exposed to AU's. Data Pipeline Goes Live - all Interchanges. Dec. Count Snapshot implemented. SPED EOY Snapshot implemented. August 23. rd. District/AU Login functionality implemented. Last updated: 7/30/13. Pupil Enrollment (Student October) Count 2013 Training Schedule ...
  • Diapositive 1 - Université de Namur

    Diapositive 1 - Université de Namur

    To date, the 3-D coordinates of TDO from Ralstonia metallidurans (rmTDO)(7) and Xanthomonas Campestris (xcTDO)(8) only have been reported. As these two bacterial strains share a high sequence identity with the human form, this constitutes an excellent template to build...
  • September 6, 2019 - cpuc.ca.gov

    September 6, 2019 - cpuc.ca.gov

    BTM resources. supply-side resource with ELCC values (BTM PV only, other resources such as AAEE remain load-modifiers) supply-side resource with ELCC values (BTM PV only, other resources such as AAEE remain load-modifiers) BTM PV not given QC value - on...
  • 7th International Health Impact Assessment Conference

    7th International Health Impact Assessment Conference

    Lack of routine data for monitoring inequalities Assumption that systematic reviews and RCTs are not suitable for real life community initiatives Assumption that plausibility is a good basis for policy making Assumption that public health interventions can't do harm Assumption...
  • Critical Care Capacity & Immediate Life Preserving Treatment

    Critical Care Capacity & Immediate Life Preserving Treatment

    Sir Bruce Keogh's letter "professional guidance includes recommendations that, admission to a regional neurosurgical unit for life-saving, emergency surgery should never be delayed and that neurosurgical units should not refuse admission to patients requiring emergency surgery from their catchment population.
  • hello world - CmpE WEB

    hello world - CmpE WEB

    ETM 555 Supplementary Lecture Notes Version 5. / 2011 Contents: Part 1: Hardware/Software Systems, Grid / Cloud Computing * Highlight the things theyt haven't thought of - router config, finding the servers at frys * …so let's go into a...
  • Winning: Foreign Direct Investment 2015-2019 Brendan McDonagh Director

    Winning: Foreign Direct Investment 2015-2019 Brendan McDonagh Director

    Incentive aimed at regeneration of the historic inner cities of Cork, Dublin, Galway, Kilkenny, Limerick and Waterford. Encouraging people back to the centre of Irish cities to live in historic buildings; ... PowerPoint Presentation Last modified by: