# Presentation: 496718

## A Crash Course in Supercomputing: UNIX

**Rebecca Hartman-Baker**
**Oak Ridge National Laboratory**
_**[hartmanbakrj@ornl.gov](mailto:hartmanbakrj@ornl.gov)**_

- © 2004-2006 Rebecca Hartman-Baker.  Reproduction permitted for non-commercial, educational use only.

## Outline

**Introduction to UNIX**
**Useful UNIX commands**
**The vi editor**

## I. Introduction to UNIX

**History of computers**
**Motivation to create UNIX**
**Creation of UNIX**
**Creation of Linux**

## History of Computers

**Early computers (1940’s, 1950’s) had no operating system**
**Computers just “number crunching machines”**
**Computers had no keyboard, monitor, mouse, etc.**
**Input: cards; Output: line printer**

- Rear Admiral Grace Hopper at UNIVAC machine, 1957. (2)

## History of Computers

**Computers custom built by different vendors (or even same vendor!) not interoperable**
**No standards, so programs must be completely rewritten for other platforms**

- IBM Punch Cards (1950s-1970s) (2)

- IBM Desktop Hand-Operated Card Punch (1960s) (2)

## Motivation

**Computer cost millions of dollars, so want to get the most use from it**
**Assign to users exclusive time blocks**
**Problem: inconvenient (what if your time is 2–4 a.m. Saturday?)**
**Must be better way to share resources!**

- Illiac IV, A $31 million machine built in 1965 by the University of Illinois and Burroughs Computer Company. (2)

## Creation of UNIX

**Ken Thompson and Dennis Ritchie at Bell Labs were impatient about resource sharing**
**So they designed operating system to handle multiple users on one computer**
**After a few failures, came up with UNIX operating system**
**UNIX became industry standard for mainframe computers**

- Dennis Ritchie and Ken Thompson using UNIX on a machine at Bell Labs, 1972 (1)

## Creation of Linux

**In 1991, Finnish college student Linus Torvalds announced creation of UNIX-like OS he wrote as hobby**
**Linux written for PC instead of mainframe architecture**
**Linux distribution available for free**
**Today, Linux used on servers, clusters, office computers, and many home PCs**

- Linus Torvalds (1)

## II. Useful UNIX Commands

**Concepts**
**Useful commands**
**Further help**

## Concepts

**Linux has both GUI (graphical user interface) and command line interface**
**GUI similar to Windows, MacOS, etc.**
**Command line similar to DOS, identical to UNIX**
**Case sensitive: ****myfile****, ****MYFILE****, and ****MyFile**** are three different file names**
**One main difference between DOS and *nix: file separator in *nix is *****forward slash***** (/), not *****back slash***** (\)**

## Useful Commands

**See UNIX commands handout**
**man**** is the most useful command ever (type ****man man**** to find out why!)**
**To remotely log in to UNIX/Linux machine:****	****ssh username@machinename****	****	****(e.g. ****ssh hqi@fourier-desk.ornl.gov****)**
**To log out, when you are done, type ****exit**** or ****logout**** and press enter**

## Further Help

**Unix Tutorial for Beginners **_**[http://www.ee.surrey.ac.uk/Teaching/Unix/](http://www.ee.surrey.ac.uk/Teaching/Unix/)**_
**DOS to UNIX Translation **_**[http://www.mcsr.olemiss.edu/unixhelp/DOStoUNIX.html](http://www.mcsr.olemiss.edu/unixhelp/DOStoUNIX.html)**_
**UNIX Command Summary **_**[http://www.utexas.edu/cc/docs/ccug1/commandsum.html](http://www.utexas.edu/cc/docs/ccug1/commandsum.html)**_

## III. The vi Editor

**History of editors**
**Creation of vi**
**vi concepts**
**Useful vi commands**

## History of Editors

**No editors for cards**
**Upon invention of terminal, line editor ****ed**** created**
**ed**** consisted of 24-line terminal, no ability to scroll back  **

- DEC PDP 12 Console, 1969 (2)

- CDC 6600 Supercomputer Console, 1964 (2)

## Creation of vi

**In 1975-76, Bill Joy was **
**	****grad student at Berkeley**
**Dissatisfied with ****ed****, he **
**	****and his friends hacked **
**	****around on ****ed**** and made **
**	****improvements**
**Joy and Berkeley counterparts gave away ****vi**** to everybody**
**Thus ****vi**** became part of basic UNIX**
**Every *nix system has ****vi****, while not all have other editors such as ****emacs**** and ****pico**

- (1)

## vi Concepts

**Two modes:**
***Command Mode:***** Enter commands to delete, cut, paste, save, quit, etc.**
***Text Entry Mode:***** Type characters in file**
**If you can’t tell which mode you’re in, press ****ESC ****and you will then be in command mode**
**vi**** is case-sensitive: J and j do very different things!**
**To use ****vi****: at command prompt type ****vi filename**** to edit file ****filename**** (or can just type ****vi**** without filename to open new buffer)**

## Useful vi Commands

**See vi commands handout**
**Getting into text entry mode: type ****i a o**** or ****O**** in command mode**
**.**** redo most recent command**
**u**** undo most recent command**
**$**** go to end of line**
**0****  (zero) go to beginning of line**

## vi Resources

**vi Editor Tutorial **_**[http://www.ualberta.ca/HELP/gpu/vi.html](http://www.ualberta.ca/HELP/gpu/vi.html)**_
**List of Commands for vi Unix Editor **_**[http://www.chem.brown.edu/instructions/vi.html](http://www.chem.brown.edu/instructions/vi.html)**_
**Basic vi Commands **_**[http://www.cs.colostate.edu/helpdocs/vi.html](http://www.cs.colostate.edu/helpdocs/vi.html)**_
**vi Lovers Home Page http://thomer.com/vi/vi.html**

## Bibliography/Resources

**The Creation of the UNIX* Operating System http://www.bell-labs.com/history/unix/**
**History of UNIX and Linux http://www.computerhope.com/history/unix.htm**
**Biography of Linus Torvalds http://www.brainyencyclopedia.com/encyclopedia/l/li/linus_torvalds.html**
**Interview with Bill Joy http://www.cs.pdx.edu/~kirkenda/joy84.html**

## Bibliography/Pictures

**(1) UNIX/Linux Picture Gallery (people) http://penguin.dcs.bbk.ac.uk/academic/unix/linux/slides/**
**(2) Lexicon’s History of Computing (computer hardware) http://www.computermuseum.li/Testpage/02HISTORYCD-Index.htm**