1 / 124

COMP 104: Intro to Unix

COMP 104: Intro to Unix. Week 1. Agenda. Welcome to Comp 104! Roster and Introductions Class Web Site https://online.franklin.edu/CourseLogin?section=comp104-23ff Personal Web Site https :// cs.franklin.edu/~morrisok/comp104 /. Agenda – Activity 1. Introduction to UNIX

jeroen
Télécharger la présentation

COMP 104: Intro to Unix

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. COMP 104: Intro to Unix Week 1

  2. Agenda • Welcome to Comp 104! • Roster and Introductions • Class Web Site • https://online.franklin.edu/CourseLogin?section=comp104-23ff • Personal Web Site • https://cs.franklin.edu/~morrisok/comp104/

  3. Agenda – Activity 1 • Introduction to UNIX • What is an operating system? • Brief history of the Unix Operating System • The design philosophy of Unix

  4. Agenda - Activity 2 • How to use the UNIX system • Korn shell • Command Line interface • Demonstration of login procedure • How to use PuTTY to log into the class Unix server einstein. • Changing your global password on email.franklin.edu • (login, passwd, changepasswd, exit) • Practice login procedure (Individual) • Practice changing password (Individual) • The shell and environment variables • (echo, set, export, setenv) • Break (10 minutes)

  5. Agenda – Activity 3 • UNIX Online Manual • What is it? How can it help? • (man, whatis) • Demonstration of Online Manual • UNIX Commands • Working with files: • (ls, cat, more, wc, lp) • Demonstration of working with files commands. • Break (10 minutes)

  6. Agenda - Activity 3 Continued • More UNIX Commands • Getting System Information: • (date, finger, whoami, whereis, who, hostname, uname) • Demonstration of system information commands. • In Class Assignment #2 • Other Interesting Commands: • (echo, exit, set, setenv, alias, talk) • Demonstration of other interesting commands. • In Class Assignment #3 • Preview of next week • In class assignment

  7. Professor Information • D Kris Morrison • Work Number : 435-1303 • Home Number: 833-4725 • Email: morrisok@frankin.edu • I can not check email during the day. I will check email every evening and multiple times on the weekends.

  8. Course Assignments • The subject line for your assignments and papers must be: Comp104LastNameAssignmentNumber For example: Comp104Morrison1-1

  9. Course Assignments If you email a question, please put the word “Question” in the subject line.

  10. Activity 1

  11. Operating Systems What is an Operating System? • A master control program • It controls the execution of application programs • Acts as a primary interface between user and hardware

  12. Operating Systems What functions does an operating system do? • Controls memory usage • Maintains file storage system • Schedules work • Provides accounting • Provides security

  13. Operating Systems Three types of Operating Systems • Single-user, single-process • DOS • Single-user, multiple-process • OS/2, Windows NT, Windows XP • Multi-user, multi-process • Unix, Linux, VM, MVS

  14. Operating Systems What objectives should we consider when designing an Operating System? • Convenience • Functionality • Efficiency • Ability to evolve

  15. History of Unix Unix was developed in 1969 by Ken Thompson of Bell Labs (now AT&T). • http://www.bell-labs.com/history/unix/ • http://www.levenez.com/unix/

  16. From Multics to Unix • Multics (Multiplexed Information and Computing Service) was a collaboration between Bell Labs, GE, and MIT. It was a time-sharing operating system that supported multiple users. (~ 1965 - 1969) • Ken Thompson, who worked on Multics, created his own operating system. It was a single-user operating system, so he called it Unics (Uniplexed Information and Computing Service) • Unics eventually became Unix

  17. Design Philosophy of Unix Unix has three important characteristics: • It is Multi-Tasking • It is Multi-User • It is Portable Unix is also considered to be an ‘Open’ system. It can be customized to meet your needs.

  18. Design Philosophy of Unix • Designed by smart people for smart people • Does not suffer fools gladly

  19. The Many ‘Flavors’ of Unix There are many versions of Unix, including: • AIX (IBM) • HP-UX (Hewlett Packard) • Solaris (Sun Microsystems) • Ultrix (Digital Equipment Corporation) • Unixware (Novell) • Linux (Linus Torvalds) • NetBSD FreeBSD At Franklin, we will use Sun Solaris for Unix training.

  20. The Unix Connection There are several types of computers in a Unix network: • Host Computers • This is the main computer that performs the work

  21. The Unix Connection • Terminal Computers • These are the computers that you use to connect to the Host. They consist of a monitor and a keyboard. • There are two types of terminals: • Graphical User Interface (GUI/X-Windows) • Character User Interface (CUI)

  22. Terminal Terminal Terminal Host The Unix Connection

  23. Terminal Terminal Our Technical Environment Terminal Terminal Server einstein

  24. Activity 2

  25. The Unix Shell Unix runs a “Shell” that allows you to execute commands. You can think of this as a Command Processor (program). The most commonly used shells are: • Bourne • Korn • C

  26. The Korn Shell This shell was created by David Korn, a scientist at Bell Labs. The name of the Korn shell program is ksh.

  27. Korn Shell Concepts Shell Variables * The shell uses Variables to maintain and pass information between programs Examples: TERM, PATH, SHELL, PRINTER, PAGER, PS1 To display the value of a variable:echo $TERM Extra: Users can define their own variables MYVAR=“Unix is cool” print $MYVAR

  28. Korn Shell Concepts The Initialization file (.profile) • The commands in this file are executed each time you login. Located in your home directory. • Shell variables PATH, TERM, PS1, and PRINTER are initialized in your local .profile • Umask and some aliases are also set in your local .profile • Use “vi” editor to change, or customize your .profile

  29. Korn Shell Concepts The PATH shell variable * The variable tells the shell where to look for programs. Example: PATH=.:/export/home/morris07/bin:/usr/local/bin:/bin:/usr/bin

  30. Command Line Interface You will work from a Command Line to type in commands. The entire line you type in is the Command Line. Separate multiple commands using semicolons. /export/home/morris07/>________________ You type in commands and then type <enter> General format of command: command-name options parameters NOTE: Unix is CaSe sEnSiTiVe!!

  31. The History File The Shell saves all commands entered in a list called the HISTORY FILE. • This history file is located in your home directory. (.sh_history) • Each command gets an ID# starting at 1. • To display the history list use the historycommand. • To re-use a command in the history file, you can use the r command:r, r 24, r da, r w • Built-in-editors let you recall, edit, and re-execute commands from the history file or the current command you are currently typing.Use “vi”commands to edit commands. <Esc>, <Enter>

  32. Logging Into Unix PuTTY is freeware that provides secure access from a PC • Required for secure access into the class Unix server einstein from our classroom. • Required for secure access from a remote location, such as your home or your office • Download PuTTY and view directions at the CLAS Lab Reference Manual web page: http://www.franklin.edu/programs/comp/resources/claslab/index_html/view

  33. Logging Into Unix Locate the PuTTY icon on your desktop and double click to open.

  34. Logging Into Unix einstein.franklin.edu cs.franklin.edu 192.70.252.8 Select SSH Highlight cs and Select Load Select Open

  35. Logging Into Unix

  36. Login Demonstration

  37. Practice Logging Into UNIX

  38. Unix Commands: login Use login to log on to the system login: • Actually, this is the UNIX program that is run so you can login to the einstein UNIX server.

  39. Unix Commands: passwd The standard Unix command passwd or changepasswdis not available to change your einstein password at Franklin University. Use web page: https://email.franklin.edu/ to change your password globally. For other Unix systems, use passwd to change your login password and password attributes.

  40. Changing your password

  41. Changing your password

  42. Practice Changing Your Password

  43. Unix Command Syntax • The format of all Unix commands is • Command {Options..} (Parameters..} • Commands can have only options. • Commands can have only parametes. • Commands can have both. • Commands can have neither.

  44. Unix Command Syntax • Options • Follow directly after the command • Indicated by a minus sign (-) • Multiple options can be specified in any order • Control how the command executes

  45. Unix Command Syntax • Parameters • Parameters pass information to the command. • The most common parameter is file name. • Tell the command what to operate on.

  46. The Unix Shell: exit Use exit to end the execution of the current shell. Will log out from Unix. /export/home/morris07/>exit Note: You can also use logout to log out from Unix

  47. The Unix Shell: <cntl> C • To halt the execution of a command, use ^c (read ‘control c’). Note: Whenever you see ‘^’ in Unix, it means ‘hold the <ctrl> key’.

  48. The Unix Shell: print (echo) Use print to echo arguments to the command line /export/home/morris07/>print “hello” Use the $symbol for Environment Variables /export/home/morris07/>print $TERM /export/home/morris07/>print $SHELL

  49. The Unix Shell: echo (print) • The “echo” command works exactly the same way as “print”. • Dr. Korn intended “print” to be used. • “Print” is implemented the same way on all Unix systems. “Echo” may have some differences.

  50. Demonstration of echo

More Related