introduction to unix- cs 21
DESCRIPTION
Introduction To Unix- CS 21. Lecture 1. Overview Of Today’s Lecture. Class introduction Brief history of Unix Hacker mentality Unix design mentality. Syllabus. Instructor: Jason Villarreal T.A. : Ioannis Drougas Lecture Times: TR 9:40-11:00 Lab Times: Thursday 2-5, 6-9 - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/1.jpg)
Introduction To Unix- CS 21
Lecture 1
![Page 2: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/2.jpg)
Overview Of Today’s Lecture Class introduction Brief history of Unix Hacker mentality Unix design mentality
![Page 3: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/3.jpg)
Syllabus Instructor: Jason Villarreal T.A. : Ioannis Drougas Lecture Times: TR 9:40-11:00 Lab Times: Thursday 2-5, 6-9 Lab attendance is mandatory,
there will be lab assignments each lab
![Page 4: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/4.jpg)
Books Required: “Teach Yourself Unix in
24 Hours” by Dave Taylor. Recommended:
Unix Power Tools, 3rd Edition* Perl in a Nutshell* The LaTeX Companion*Available online for free to UCR
students at library.ucr.edu/oreilly
![Page 5: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/5.jpg)
Grading 3 Quizzes – 15% total (5% each) 1 Midterm – 20% 1 Final – 30% Lab Assignments – 25% total Homework – 10%
![Page 6: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/6.jpg)
Special Note On Cheating Cheating will not be tolerated What constitutes cheating?
Sharing of answers to questions on homework, assignments, or tests
Sharing of code Using anyone else’s work as your own
Discussion of high level concepts and studying text is all right.
Moral: If you’re not sure, don’t do it!
![Page 7: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/7.jpg)
What Are You Going To Get Out Of This Class? First answer: Whatever you put into this
class Specifically:
Working knowledge to accomplish most tasks in Unix
From simply managing files to programming projects and scripting
Everything to get you familiar with what is necessary in the rest of the computer science curriculum
An appreciation for the way things are done in Unix
![Page 8: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/8.jpg)
A Quick Movie Clip To Motivate Us
![Page 9: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/9.jpg)
This Is NOT A Typical Unix System Hollywood (and others) associate Unix
with “smart” computer users Unfortunately, Unix is not flashy
Nothing appealing about watching a command prompt
Navigating through a prompt would be much faster, but not nearly as exciting
Will knowledge of Unix help save you from rampaging dinosaurs?
![Page 10: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/10.jpg)
History Of Unix Unix has been around in one form
or another since 1969 (probably before any of us were born)
Why is it important to know the history?
Why hasn’t it disappeared? What has fueled its growth?
![Page 11: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/11.jpg)
Today, Two Major Divisions
Linux
Mac OS X (Darwin)
FreeBSD Solaris
Unix (1969)
System V systems (1983)
BSD systems (1978)
IRIX
Hurd HP-UX
![Page 12: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/12.jpg)
A Family Tree Display
![Page 13: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/13.jpg)
System V Versus BSD If you know one, you can learn the
other fairly quickly Some programs have different flags
and run in different ways Some files are located in different
areas We will cover System V in this
class (Linux in lab)
![Page 14: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/14.jpg)
1969 – The Origin of Unix Multics – a timesharing operating system
that grew too complex for its own good Timesharing was novel, as batch processing
was the accepted norm Ken Thompson of Bell Labs
Bell Labs withdrew from Multics support, and Ken lost a system to play “Space Travel,” a game he wrote
He wrote the first version of UNIX (UNICS) on a PDP-7
Soon joined by Dennis Ritchie
![Page 15: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/15.jpg)
Computers of that age No such thing as a video display No keyboard as we know it
A teletype was used to communicate with the computer
Basically a glorified electronic typewriter
![Page 16: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/16.jpg)
PDP-7
![Page 17: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/17.jpg)
Unix features From the very beginning, this was a
programmer’s environment Ability to code and test in one session
Interactive computing was stressed over batch processing Batch processing involved coming up with a
large volume of work that needed to be computed and feeding that work to the computer during your assigned time
Timesharing allows several programs to be run at once, although each takes a little more time
![Page 18: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/18.jpg)
1970’s 1971-1973: In order to have this OS
on other systems, Thompson and Ritchie create C and rewrite the OS in C
Unix use slowly spreads among academic circles
1977: First BSD release (source code included!)
SCO created in 1978
![Page 19: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/19.jpg)
The C Connection From the early 1970’s, C and Unix
have gone together C was designed as a sort of
“portable assembler” Low level enough to do things fast High level enough to be human
readable C remains the language of choice
![Page 20: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/20.jpg)
1980’s – The Unix Wars 1983 – Networking gets added to BSD Sun Microsystems gets founded
Early idea was to create a perfect Unix system with networking built in and sell it
Department of Justice breaks up AT&T AT&T rushed to commercialize System V
Source code was no longer free Error 2: Focus on the wrong market
Every version of Unix started competing with every other version, and Microsoft took over
![Page 21: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/21.jpg)
1985-93’s – FSF and Gnu Once you give people something for free,
they don’t want to have to pay for it The Free Software Foundation (1985)
Gnu (Gnu’s not Unix) Create free versions of popular tools (1986 –
gcc, 1987 – most tools) Overall goal was to develop a free kernel (It
hadn’t happened by 1993) Squabbling continued and Unix suffered
![Page 22: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/22.jpg)
Linux In 1991, Linus Torvalds announced
the Linux project A free Unix kernel for x86 systems Used Gnu tools from the very
beginning By 1993, Linux had both internet
capability and X capability Just in time for the big internet boom
![Page 23: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/23.jpg)
Linux’s Success Internet culture and newsgroup
postings caused a group of similar minded people to contribute and create a worthwhile kernel
A competing free attempt had problems The free BSD attempt was mired in a
lawsuit (3 files were copied illegally) The Berkeley development group
disbanded
![Page 24: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/24.jpg)
Free Software Foundation Founded by Richard Stallman
Wrote original version of gcc and gdb Software should be free, because it should
be free As in “free speech, not free beer”
Wrote the General Public License (GPL) You are free to do whatever you want as long as
the source code goes with it no matter what Controversy: Anything derived from a GPL’d work
must itself be GPL’d
![Page 25: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/25.jpg)
Open Source Movement Software should be free just
because – FSF viewpoint Software should be free because
free software is better – Open Source Movement viewpoint Every problem can be eliminated if
more people look at it
![Page 26: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/26.jpg)
The Hacker Connection The entire history of Unix has been
co-mingled with the history of hackers
The hacker mentality continues to drive the use and progress of Unix
Groups of people create and maintain Linux and BSD systems for fun (and to better their resume)
![Page 27: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/27.jpg)
Where Are We Today, And Where Are We Going? The Single Unix Specification have been
approved as an international standard If a system wants to be called Unix, it has to
conform to the guidelines in this standard The open source movement continues
to thrive and shows no slowing down As anger and resentment for Microsoft
continues (some unwarranted), people continue to look for a better alternative
![Page 28: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/28.jpg)
History of Hacker Culture People have been tinkering and building
for a long time Cars, radios, woodworking, etc.
Why wouldn’t people tinker around with computers and operating systems? You need the source code in order to tinker
with an operating system Hacking Unix is fun
![Page 29: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/29.jpg)
Important distinctions Hacker
One who likes to build tools, programs, or systems for the fun of it
Enjoys stretching capabilities of systems rather than just doing the minimum necessary
Media’s use of the word: Evil man out to get you!
Cracker One who breaks into systems with the express
purpose of monetary gains or to cause trouble Script kiddie: lowest form of cracker
![Page 30: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/30.jpg)
Some Handy Web Sites Jargon file
All the definitions necessary for understanding the hacker culture
Slashdot.org The site where information “that
matters” is posted Freshmeat.net
New tools and projects postings
![Page 31: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/31.jpg)
Hacker Mentality Prefer an elegant solution to a
kludge Information sharing is a good goal
Not a necessary evil, but something to strive for
Some may exploit software to make the software better and not for personal gain
![Page 32: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/32.jpg)
Mentality Of Unix Unix was designed with the K.I.S.S.
principle Keep It Simple, Stupid!
Why do something repetitive when you can automate? Write scripts and programs for simple
or commonly used tasks Don’t overly complicate matters
![Page 33: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/33.jpg)
“Third System Effect” First system: a simple prototype
that is missing needed functionality Second system: overly complex
system that throws everything in Multics was a second system Collapses under its own weight
Third system: simple system with improved functionality
![Page 34: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/34.jpg)
Analogy
Do one thing, but do it well Hidden menu is like command
line options Still getting a burger, just different
= Unix Commands
??
![Page 35: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/35.jpg)
Unix Versus Windows Is Unix purposefully anti-GUI?
Not really… Several window managers exist for X-
windows Basing an OS on a GUI makes it more
complicated than it needs to be Simple interfaces allow for different
programs to easily communicate Counterexample: How many different
formats does Microsoft Word save as? How many of those can WordPad read correctly?
![Page 36: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/36.jpg)
Common Differences Between Unix And Windows Registry
Unix programs keep track of their own files GUI
Built on top of Unix Built in the middle of Windows (recently)
Command line In Unix, the main interface with a program In Windows, barely supported if at all
![Page 37: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/37.jpg)
Multitasking/Multiuser (Multichoice) Unix was always designed as a
multiuser/multitasking system More than one user can be logged on one
machine at a time More than one process can be running at one
time (time sharing) Many different ways exist to do things in
Unix Different graphical interfaces, different
commands, etc.
![Page 38: Introduction To Unix- CS 21](https://reader035.vdocuments.net/reader035/viewer/2022081506/5681503f550346895dbe3e01/html5/thumbnails/38.jpg)
For more information Read chapter 1 in the book Read “In the Beginning was the
Command Line” by Neal Stephenson joesacher.com/documents/commandline.php
Visit www.faqs.org/docs/artu/ Don’t worry about most of the book,
but look at the philosophy and history sections