prime view, inc.1. 2 history, a brief overview written by ken thompson and dennis ritchie (turing...

14
PRIME VIEW, INC. 1

Upload: kory-wheeler

Post on 17-Jan-2016

215 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 1

Page 2: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 2

History, a brief overview • written by Ken Thompson and Dennis Ritchie (Turing Award 1983)• developed at Bell Laboratories, USA, derived from multics (1969) • Thompson developed a new programming language 'B' • Ritchie enhanced 'B' to 'C' and helped develop 'UNIX' • Two flavors,

SYSTEM V (Commercial, run by AT&T) and BSD (Educational, run by Bell Labs)

• Recent developments are graphical interfaces, MOTIF, X Windows, Open View

A free UNIX system called LINUX is also available for download from the Internet or available on CD-ROM. More of UNIX history - see appendix.

Page 3: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 3

What is UNIXUNIX is a multi-user multi-tasking multi-threaded highly portable time-sharing networked operating system utilizing shared memory. The job of an operating system is to orchestrate the various parts of the computer -- the processor, the on-board memory, the disk drives, keyboards, video monitors, to perform useful tasks.Main features:• multi-user

more than one user can use the machine at a time supported via terminals (serial or network connection)

• multi-tasking, more than one program can be run at a time • hierarchical directory structure, to support the organisation and maintenance of files • portability

only the kernel ( <10%) written in assembler. This meant the operating system could be easily converted to run on different hardware platforms ranging from PCs and Macs to Cray supercomputers

• tools for program development, a wide range of support tools (debuggers, compilers) The philosophy behind the design of UNIX was to provide simple, yet powerful utilities that could be pieced together in a flexible manner to perform a wide variety of tasks. The UNIX operating system comprises three parts: The kernel, the shell and the standard utility programs, and the system configuration files.

Page 4: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 4

Kernelschedules programsmanages data/file access and storageenforces security mechanismsperforms all hardware access

Today you can find several flavors of the UNIX operating system (also known as the "kernel"). AT&T's original version evolved into System V (pronounced "system five"). The version that AT&T licensed to the University of California at Berkeley is called BSD (Berkeley Software Distribution). It is now the de facto standard in the academic community, (i.e., it's free). Other versions are also available from commercial vendors: Sun's Solaris, SCO and Microsoft's XENIX, IBM's AIX, DEC's ULTRIX, Apple's A/UX, and the free Intel-based Linux. Kernel executable file is usually named unix (System V origin) or vmunix (BSD origin).

Configuration filesThe system configuration files are read by the kernel, and some of the standard utilities. The UNIX kernel and the utilities are flexible programs, and certain aspects of their behavior can be controlled by changing the standard configuration files. One example of a system configuration file is the filesystem table "fstab" , which tells the kernel where to find all the files on the disk drives.

Page 5: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 5

ShellUsers rarely use UNIX directly, however. The utility software that interprets a user's commands for the kernel is called the shell. Here too, there are several flavors. The original and most common shell is the Bourne shell (its prompt is the "$"). The C shell ("%" or "") is newer and provides an extensive command language similar to the C programming language. The Korn shell (also "$") attempts to combine the best of both earlier shells. More than one shell is often available to users on a UNIX system.

Utilities file management (rm, cat, ls, rmdir, mkdir) user management (passwd, chmod, chgrp) process management (kill, ps) printing (lp, troff, lpr)

program development tools

Page 6: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 6

Summary of Basic DOS Commands

help | more displays all commands available to user. dir     lists names of files and subdirectories in a directory.

cd     displays the name or changes current directory

mkdir    creates a directory

del deletes one or more files copy copies one or more files to another directory

rmdir deletes a directory

move moves files and renames files and directories

time displays or sets the timedate displays or sets the date

echo displays messages or turns command-echoing on/off

exit quits the program or command interpreter

Page 7: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 7

Logging In

There are three main ways to connect to UNIX machine (node)- direct terminal connection- network terminal connection using dumb or X-terminal- network terminal connection using a “smart” terminal (PC)

Terminal Emulator - a program running on your PC and representing it to UNIX server as a terminal of known type. In our case we have NT application called “Reflections”

Once you are connected, UNIX will prompt you for your login name. Type your unique userid (student1, student2, student3,... student0) assigned to you. At the password prompt, type your password - all users have the same password: "nyc123". (Your password will not be printed on the screen.) Try different types of connection:         - telnet  (windows standard tool in accessories)         - Reflection/telnet         - telnet from unix prompt         - ftp Use "ps" command and "who" command to find out about connections.

Page 8: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 8

Setting Passwords

If you are using a temporary password, you should change it immediately. It is also a good idea to change your password periodically. Unlike your login name which may be known by many people, only you should know your password. Make your password 6 to 8 characters long. Make it hard to break by combining capital letters, lowercase letters, and punctuation. Avoid using family names, pet names, words found in dictionaries, birth dates, anniversary dates, and obvious numbers (drivers license, license plate, phone). Do not use common words, even if you add a number to the password (e.g., Gandalf, red3, scottX, etc.).

Changing Your Password

To change your password, type: passwd. UNIX will prompt you for your old password, then your new password. UNIX will then ask you to retype the new password to confirm it. Once you've confirmed

it, your new password will be in effect. Use it the next time you log in.

Page 9: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 9

Summary of Basic UNIX Commands

Below is a reference list of the UNIX commands you will use most often and that are necessary for a basic use of UNIX. command -flag(s) argument(s)

man (manual) displays help or manual documentation. man command displays manual information for the specified commandman -k keyword displays 1 line synopsis of each manual

section referring to the keyword

ls (list) provides a directory listing. ls         lists a directory in columns ls -l     gives a fuller listing including file permissions,

size, date createdls -al    similar to the above but includes "dot"/hidden files

cd (change directory) cd returns you to the home directorycd .. moves up one directory levelcd ../.. moves up two directory levelscd subdirectory moves to named subdirectory

mkdir (make directory) mkdir subdirectory creates a directory within the current directory

  

Page 10: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 10

rm (remove) deletes files* rm filename        deletes the named filerm -i filename     deletes named file after prompting to make

sure you wish to remove itrm deletes (removes) filesrm -r recursive remove, can delete files and

directories

cp (copy) cp file1 file2 copies file1 to file 2cp file1 directory             copies file 1 to named directorycp file1 file2 directory       copies file1 and file2 to named directory

rmdir (remove directory) rmdir dir1                deletes directory within the current

directory (if directory is empty)

mv (move) moves or renames one or more files. mv file1 newname                renames file1mv directory newname       renames directorymv file1 directory              moves file to named directorymv file1 directory/newname moves file1 to named directory and renames

*BE EXTREMELY CAREFUL with rm and never use rm* ! there is no undelete command!

Page 11: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 11

date displays date and time. echo prints its arguments on the screen.

passwd changes login password.

Page 12: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 12

Exercises with UNIX Commands

1. Try to get help on the following commands: pwd, ls, cd, cat, cp, mv, echo, ps, who

2. Make a new directory called “projects”3. Run “ls” to confirm your directory was created4. Run “ls –l” to view long view of your directory5. Find out which other “flags”, if any, are available with the “ls” command and

try to run them.

6. Run the “pwd” command.7. Run “cd projects” and run the “pwd” command again. What is the change?

8. Create a new subdirectory called “logs”.9. Run “cd logs”.10. Run “ls -l; pwd”.11. Run “cd ..”12. Run “pwd”13. Run “cd”14. Run “pwd”

Page 13: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 13

15. Go back to your “logs” directory.16. Run “who” command.17. Place the contents of the “who” command into a file called “users.log” by

running “who > users.log”18. Using command “wc” count number of words in “users.log”19. Get help on the “type” command.20. Run “type users.log” to view the contents.21. Create another file called “myfiles.log” using one of the commands you already

know. (use “ls” or one of its forms)22. View the contents of the “myfiles.log”23. Go back to your “projects” directory.24. Try to view your log files from the “projects” directory without having to change

directories.25. Try to rename and delete one of the files.26. Try to copy one of the files to the local directory. (you may need to find out what

is the current working directory with command “pwd”).27. Copy “logs” directory into “archives” directory, (you may need to create the

directory first).28. Try to remove the “logs” directory without having to delete its contents.29. Copy all files from the “archives” directory into your working directory in one

shot.30. Use man pages to get information on “-p” flag of the “mkdir” command. Try it.

Page 14: PRIME VIEW, INC.1. 2 History, a brief overview written by Ken Thompson and Dennis Ritchie (Turing Award 1983) developed at Bell Laboratories, USA, derived

PRIME VIEW, INC. 14

Useful links for this course.

History:http://www.paralogos.com/DeadSuper/http://www.computer50.org/mark1/photogallery.htmlhttp://perso.wanadoo.fr/levenez/unix/

UNIX:http://www.arch.su.edu.au/~doug/Unixhelp/DOStoUNIX_.html == DOS to UNIX, basic commandshttp://www.itknowledge.com/reference/standard/0672315238/ewtoc.html == Sam's UNIX in 10 min.http://www.isu.edu/departments/comcom/unix/workshop/unixindex.html - Idaho State Univ. Tutorialhttp://wks.uts.ohio-state.edu/unix_course/ Ohio Univ. Course; book and slideshttp://theory.uwinnipeg.ca/UNIXhelp/ == UNIXhelp from Univercity of Edinburg (can DOWNLOAD)http://www.ugu.com/ == UNIX Guru Universe

http://www.ugu.com/sui/ugu/show?help.beginners -- Start here, check "Basics", "Fundamentals"http://riceinfo.rice.edu/Computer/Documents/Unix/unix1.01.pdf -- Get reference cardhttp://riceinfo.rice.edu/Computer/Documents/Unix/unix1.pdf -- Get nicely formatted doc on basicshttp://riceinfo.rice.edu/Computer/Documents/Unix/unix18.pdf -- UNIX scripts (csh, sh 15 pages each)

http://goforit.unk.edu/unix/part1_0.htm -- Learning UNIX by Brian Brown (Advanced): Acessments, Notes, TESTS)http://www.usenix.org/sage/sysadmins/sysadmins.html -- Sysadmins sitehttp://www.uwsg.indiana.edu/usail/ -- Basic UNIX Tutorial used by many univercities (14 chapters)http://www.oase-shareware.org/shell/index.html --- SHELLdorado = Scripts, scripts, scripts.http://www.unixguide.net/ -- UnixGuidehttp://www.elementkjournals.com/sun/ -- Inside Solaris

Free Shell access:http://www.shellyeah.org