1.26k likes | 1.48k Views
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
E N D
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 • What is an operating system? • Brief history of the Unix Operating System • The design philosophy of Unix
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)
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)
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
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.
Course Assignments • The subject line for your assignments and papers must be: Comp104LastNameAssignmentNumber For example: Comp104Morrison1-1
Course Assignments If you email a question, please put the word “Question” in the subject line.
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
Operating Systems What functions does an operating system do? • Controls memory usage • Maintains file storage system • Schedules work • Provides accounting • Provides security
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
Operating Systems What objectives should we consider when designing an Operating System? • Convenience • Functionality • Efficiency • Ability to evolve
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/
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
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.
Design Philosophy of Unix • Designed by smart people for smart people • Does not suffer fools gladly
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.
The Unix Connection There are several types of computers in a Unix network: • Host Computers • This is the main computer that performs the work
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)
Terminal Terminal Terminal Host The Unix Connection
Terminal Terminal Our Technical Environment Terminal Terminal Server einstein
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
The Korn Shell This shell was created by David Korn, a scientist at Bell Labs. The name of the Korn shell program is ksh.
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
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
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
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!!
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>
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
Logging Into Unix Locate the PuTTY icon on your desktop and double click to open.
Logging Into Unix einstein.franklin.edu cs.franklin.edu 192.70.252.8 Select SSH Highlight cs and Select Load Select Open
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.
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.
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.
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
Unix Command Syntax • Parameters • Parameters pass information to the command. • The most common parameter is file name. • Tell the command what to operate on.
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
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’.
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
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.