1 / 14

Chapter 1 First Steps

Chapter 1 First Steps. 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'

zan
Télécharger la présentation

Chapter 1 First Steps

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 1 First Steps 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. PRIME VIEW, INC.

  3. What is UNIX • UNIX 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. PRIME VIEW, INC.

  4. Kernel • schedules programs • manages data/file access and storage • enforces security mechanisms • performs 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 files • The 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. PRIME VIEW, INC.

  5. Shell • Users 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 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 time date displays or sets the date echodisplays messages or turns command-echoing on/off exit quits the program or command interpreter 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. 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 PasswordTo 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. 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 command man -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 subdirectorycreates a directory within the current directory 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) files rm -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! PRIME VIEW, INC.

  11. date displays date and time. echo prints its arguments on the screen. passwd changes login password. PRIME VIEW, INC.

  12. Exercises with UNIX Commands • Try to get help on the following commands: pwd, ls, cd, cat, cp, mv, echo, ps, who • Make a new directory called “projects” • Run “ls” to confirm your directory was created • Run “ls –l” to view long view of your directory • Find out which other “flags”, if any, are available with the “ls” command and try to run them. • Run the “pwd” command. • Run “cd projects” and run the “pwd” command again. What is the change? • Create a new subdirectory called “logs”. • Run “cd logs”. • Run “ls -l; pwd”. • Run “cd ..” • Run “pwd” • Run “cd” • Run “pwd” PRIME VIEW, INC.

  13. Go back to your “logs” directory. • Run “who” command. • Place the contents of the “who” command into a file called “users.log” by running “who > users.log” • Using command “wc” count number of words in “users.log” • Get help on the “type” command. • Run “type users.log” to view the contents. • Create another file called “myfiles.log” using one of the commands you already know. (use “ls” or one of its forms) • View the contents of the “myfiles.log” • Go back to your “projects” directory. • Try to view your log files from the “projects” directory without having to change directories. • Try to rename and delete one of the files. • 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”). • Copy “logs” directory into “archives” directory, (you may need to create the directory first). • Try to remove the “logs” directory without having to delete its contents. • Copy all files from the “archives” directory into your working directory in one shot. • Use man pages to get information on “-p” flag of the “mkdir” command. Try it. PRIME VIEW, INC.

  14. Useful links for this course. History: http://www.paralogos.com/DeadSuper/ http://www.computer50.org/mark1/photogallery.html http://perso.wanadoo.fr/levenez/unix/ UNIX: http://www.arch.su.edu.au/~doug/Unixhelp/DOStoUNIX_.html == DOS to UNIX, basic commands http://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. Tutorial http://wks.uts.ohio-state.edu/unix_course/ Ohio Univ. Course; book and slides http://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 card http://riceinfo.rice.edu/Computer/Documents/Unix/unix1.pdf -- Get nicely formatted doc on basics http://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 site http://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/ -- UnixGuide http://www.elementkjournals.com/sun/ -- Inside Solaris Free Shell access: http://www.shellyeah.org PRIME VIEW, INC.

More Related