Download presentation
Presentation is loading. Please wait.
Published byAlban Bridges Modified over 9 years ago
1
CIS 90 - Lesson 3 Lesson Module Status Slides - draft Flash cards – started properties – page numbers - No-stress quiz – done Web Calendar summary – done Web book pages - none Commands – done Welcome mailed - Lab – done Historical events mailed - 1
2
CIS 90 - Lesson 3 Quiz Please close your books, turn off your monitor, take out a blank piece of paper and answer the following questions: How do you show your path? Name four directories where one can find commands? What is the command to print the manual page for a command? 2
3
CIS 90 - Lesson 3 ObjectivesAgenda Learn how to use the UNIX communication tools write and mail. Overview on end-to-end email. Quiz Questions from last week Mini review Housekeeping Write Basic Mail More on Mail End-to-end email Other MUAs, MTAs, DA and AAs Wrap up Electronic Mail 3
4
CIS 90 - Lesson 3 Previous material and assignment 1.Questions on Labs or previous material? Setting variables (term, ps1) Inputs to a command via the command line from the user from the OS How work is divided up between shell and a command 2.Lab 2 due today submit as many times as you wish up to midnight 4
5
CIS 90 - Lesson 3 Lab 1 Results 1) On Opus, what was the prompt string? /home/cis90/guest $ x 2) What does the history command do? shows previous commands 3) On Opus, what was your uid (user id) number? xxx 503 4) On Opus, what was the name of the shell program being run? xx bash 5) What terminal device did you use to access Opus? xxxxx x /dev/pts/2 (this varies) 6) On any of the Frodo virtual terminals, what does the hostname command show? xxxxx xxxxx x frodo 7) What command shows the other users that are logged in? who 8) What command shows you the name of the computer you are interacting with? xxxxx xxxxx hostname 9) On Frodo, what three keys must be pressed locally to use terminal tty2? xx ctrl+alt+f2 10) On Frodo, if you log off one session, do you get logged off all the other sessions? no 11) On Frodo, is your command history the same for all login sessions? xxxxx no 12) What command logs you off? exit 5
6
CIS 90 - Lesson 3 Review 6
7
CIS 90 - Lesson 3 Opus (a RHEL server) A.We access the Windows PC via its keyboard and monitor. It is running the Windows OS (the XP version) B.From the PC we use Putty to access the Opus server, which runs the GNU/Linux OS (Red Hat Enterprise Linux distribution) C.On the PC we use the VMware Server Console to access the Frodo VM, which runs the GNU/Linux OS (Ubuntu distribution) D.From Frodo VM, we SSH to access Opus (different session than B) A C B What the heck are were we doing in Lab 1? D 7
8
CIS 90 - Lesson 3 Opus (a RHEL server) 8 Putty to rsimms@opus.cabrillo.edu vs just opus.cabrillo.edu
9
CIS 90 - Lesson 3 Opus (a RHEL server) 9 ssh to rsimms@opus.cabrillo.edu vs just opus.cabrillo.edu
10
CIS 90 - Lesson 3 1)Prompt 2)Parse 3)Search 4)Execute 5)Nap 6)Repeat Life of the Shell Kernel Shell Applications System Commands OS 10
11
CIS 90 - Lesson 3 Command Syntax CommandOptionsArgumentsRedirection [root@opus ~]# hostname opus.cabrillo.edu [root@opus ~]# hostname -i 127.0.0.1 [root@opus ~]# hostname -s opus 11
12
Keyboard Additional data command needs from user. E.g. passwords, math expressions, … CIS 90 - Lesson 3 Commands are Programs 0 1 2 Program (a file on drive) readwrite console keyboard (default) console screen (default) console screen (default) stderr stdin stdout Operating System Information available only from the OS. E.g. files, directories, date & time, process info, user info, tty info etc. Command line (parsed by shell): Options: … Args: … Loads into RAM 12 Commands get input from: A.Command line B.Keyboard C.Operating System
13
CIS 90 - Lesson 3 Example program to process: ls command 0 1 2 directory contents ant Blake nursery Shakespeare twister Yeats (This file information comes from the kernel) read /home/cis90/simmsben/Poems $ tty /dev/pts/1 /home/cis90/simmsben/Poems $ ls ant Blake nursery Shakespeare twister Yeats /home/cis90/simmsben/Poems $ ls ant Blake nursery Shakespeare twister Yeats /dev/pts/1 stderr stdin stdout Options: NA Args: NA 13
14
CIS 90 - Lesson 3 Example program to process: bc command 0 1 2 2+2 4/0 [rsimms@nosmo ~]$ tty /dev/pts/1 [rsimms@nosmo ~]$ bc 2> errors 2+2 4 4/0 quit [rsimms@nosmo ~]$ cat errors Runtime error (func=(main), adr=5): Divide by zero bc 4 Runtime error (func=(main), adr=5): Divide by zero /home/rsimms/errors /dev/pts/1 stderr stdin stdout Options: NA Args: NA Note: BC is an interactive command and requires user input via stdin 14
15
CIS 90 - Lesson 3 Environment Variables Names and Values $ echo $LOGNAME simmsben $ echo HOME HOME $ echo $HOME /home/cis90/simmsben $ echo $SHELL /bin/bash $ echo $HOSTNAME opus.cabrillo.edu Use $ for the “value” of a variable Analogy: Each variable is a named location. The contents of any location is the “value” of that variable. 15
16
CIS 90 - Lesson 3 Variable Names and Values Analogy: knobs and settings 16 $ echo FAN FAN $ echo $FAN $ FAN=HI $ echo $FAN HI $ echo "The fan is set to: " $FAN The fan is set to: HI $ FAN=LO $ echo "The fan is set to: " $FAN The fan is set to: LO FAN HI
17
CIS 90 - Lesson 2 Passwords Delete john.pot, john.log, john.rec …../john shadow 17
18
CIS 90 - Lesson 3 Housekeeping 18
19
CIS 90 - Lesson 3 Roll call 19
20
CIS 90 - Lesson 1 CIS 90 - Signatures The TBA (3 hours and 10 minutes) portion of the is course is required Student signatures here 20 Michael George Daniel Black
21
CIS 90 - Lesson 1 Student Survey 21 Joshua Keever Daniel Black Jaime Cervantes
22
CIS 90 - Lesson 3 Lord of the Rings Character Code Names 22 Your code names are now available
23
CIS 90 - Lesson 3 Graded Work Graded work is copied to your home directories: [rsimms@opus ~]$ ls /home/cis90/tumajan and Hidden letter proposal1 spellk tuma bigfile lab01.graded Miscellaneous proposal2 text.err what_am_i bin Lab2.0 mission proposal3 text.fxd yourlastname empty Lab2.1 Poems small_town timecal [rsimms@opus ~]$ 23
24
CIS 90 - Lesson 3 Forum Registration To Register: 1.Click on Register link 2.Agree to terms 3.For your Username to be accepted it must be: your full first and last name separated by a space e.g. Rich Simms match a name on the class roster 24 Daniel Black Joshua Keever Craig Langlo Gabriel Pantoja Joe Ferrante Jaime Cervantes
25
CIS 90 - Lesson 3 Using the Forum Use email to report typos or anything of a personal nature. Use the forum for EVERYTHING else. Usually if I get questions emailed to me that may be of interest to other students I'll ask you to post on the forum instead. Short, concise one topic posts are best. If you have a list of unrelated questions it is better to separate into single topic posts. Pick a subject line that summarizes your topic. This makes it easier to search for topics later. For trouble-shooting questions please include information so others can duplicate the problem you are having. 25 Next week is 1 st 5 post deadline
26
CIS 90 - Lesson 3 Using the Forum 26 Demonstrate - formatting, smilies, avatars, search, practice forum, members, etc. Next week is 1 st 5 post deadline Demonstration
27
CIS 90 - Lesson 3 Extra Credit 27 Link to Extra Credit page is on the Grades page Note the caps on extra credit.
28
CIS 90 - Lesson 3 Extra Credit Howtos 28
29
Internships 29 Last week we met with local businesses. Topic: paid and unpaid internships for Cabrillo CIS/CS students. Cabrillo has resources for writing resumes, interviewing, job etiquette, etc. See: http://cabrillo.edu/services/jobs Jobs mailing list: Subscribe by emailing (no subject or body): networkers-subscribe@cabrillo.edu
30
CIS 90 - Lesson 3 Write Command 30
31
write command send a message to another user CIS 90 - Lesson 3 write username [ttyname] Use ttyname if there are multiple logins by same username The receiver gets: Message from yourname@yourhost on yourtty at hh:mm … Each line you type gets sent to the other user. To end sending messages type Ctrl-D (Ctrl and D keys at the same time) The receiver will see an EOF (end of file) at the end. If the receiver wants to reply then they need to use write command as well. 31
32
write command send a message to another user CIS 90 - Lesson 3 Ctrl-D Note, the pts/4 is not needed if there is only one login by the username the message is being sent to 32
33
write command Beji chats with Mary using write commands CIS 90 - Lesson 3 simmsben simmsmar 1 1 3 3 5 (a convention, "o" used for over) 8 8 10 12 13 15 17 18 19 (Ctrl-D) 21 2 2 4 4 6 6 7 7 9 9 11 14 16 (Ctrl-D) 17 20 22 Use Ctrl-D to stop writing. Ctrl-D is EOF (End of File) and is slightly more friendly than Ctrl-C 33
34
mesg command enable or disable writes to your terminal CIS 90 - Lesson 3 simmsben simmsmar Use n to disable or y to enable 34
35
CIS 90 - Lesson 3 Class Exercise write and mesg Logon to Opus Type ls /home/cis90 to see all student usernames Introduce yourself to the other students at your table and do a back and forth test using the write command. Use mesg command to enable and disable. Start collecting each other's usernames to use for Lab 3 35
36
CIS 90 - Lesson 3 Mail Command 36
37
UNIX mail Sending messages CIS 90 - Lesson 3 simmsben richsimms@yahoo.com simmsmar Use. or Ctrl-D to end the message Intended recipients The first prompt is "Subject: ", you enter the subject, then enter the message. The last prompt is "Cc: ". After hitting Enter the message is sent 37 Benji sends an email to Rich and Mary Tip: cc yourself to save a copy of messages sent
38
UNIX Mail Reading messages CIS 90 - Lesson 3 simmsmar The & is the mail prompt. Enter a 1 to read message 1 One message is in the header list (in tray), "N" means New, "1" is the message number 38 Mary reads email from Benji
39
UNIX mail Reading messages sent from UNIX mail CIS 90 - Lesson 3 richsimms@yahoo.com 39 Rich reads email from Benji
40
UNIX Mail Replying to messages CIS 90 - Lesson 3 simmsmar Enter an r to "reply to all" for the last message read 40 Mary replies to email from Benji
41
UNIX Mail Benji gets the reply from Mary CIS 90 - Lesson 3 Entering just the message number or a "p" followed by the message number are equivalent. The p is the mail print command. simmsben 41 Benji reads reply from Mary
42
UNIX Mail CIS 90 - Lesson 3 richsimms@yahoo.com 42 Rich reads reply from Mary
43
CIS 90 - Lesson 3 Class Exercise UNIX mail Logon to Opus Work with the other students at your table Send an email to one other student Send an email to all students at your table and cc: yourself Reply to the messages you receive Start collecting each other's student usernames to use in Lab 3 43
44
CIS 90 - Lesson 3 More on Mail Command 44
45
mail command read and write modes CIS 90 - Lesson 3 Read mode: mail (to read new messages) mail –f (to read saved messages in mbox) mail –f myfile (to read saved messages in myfile) Write mode: mail simmsben mail simmsben simmsmar richsimms@yahoo.com 45
46
mail command read mode sub commands CIS 90 - Lesson 3 You are in read mode when you invoke mail with no arguments ?print these commands p print messages ngoto and print next message e edit messages d delete messages s filesave (append) messages to file u undelete messages R reply to sender(s) r reply to all m mail to specific users q quit, saving read messages to local mbox file x quit, mark all mail as unread and undeleted. h print out active message headers A consists of integers, ranges of same, or user names separated by spaces. If omitted, Mail uses the current message A consists of user names separated by spaces. 46
47
mail command (h)header sub-command CIS 90 - Lesson 3 h (print headers – e.g. list my in tray) message numbers N = New, message is unread > points to the current message (last one printed) 47
48
mail command (p)rint sub-command CIS 90 - Lesson 3 print all messages from simmsmar 48
49
mail command (p)rint sub-command CIS 90 - Lesson 3 print message 5, note that commands can be abbreviated to a single letter 49
50
mail command (p)rint sub-command CIS 90 - Lesson 3 print messages 4 -5 50
51
mail command e(x)it sub-command CIS 90 - Lesson 3 x will quit mail. All messages revert back to their original state (unread and undeleted). When you return to mail again all the messages will still be there. 51
52
mail command (q)uit sub-command CIS 90 - Lesson 3 q will quit mail. All read messages are moved to a local file named mbox. When you return to mail again those message will not appear. To read your old messages you must specify the mbox file with the –f option. 52
53
mail command Various mailbox files CIS 90 - Lesson 3 system mail box /var/mail/username (new mail arrives here and read messages are deleted on quit ) local mail box mbox (read messages go here on quit ) local mail box yourfile (messages can go here with save ) mail 53
54
CIS 90 - Lesson 3 [rsimms@opus ~]$ mail Mail version 8.1 6/6/93. Type ? for help. "/var/spool/mail/rsimms": 6 messages 6 new >N 1 jimg@opus.cabrillo.e Sun Jun 22 13:53 21/826 "Hot days and servers" N 2 simmsben@opus.cabril Thu Jul 24 12:27 16/697 "Nisene Hike" N 3 simmsmar@opus.cabril Thu Jul 24 12:28 18/728 "Don't forget to bring" N 4 simmsben@opus.cabril Thu Jul 24 12:29 17/696 "Bone lost" N 5 rsimms@opus.cabrillo Thu Jul 24 12:33 20/808 "Re: Hot days and serv" N 6 roddyduk@opus.cabril Thu Jul 24 15:41 18/691 "Salsa" & p 3-4 Message 3: From simmsmar@opus.cabrillo.edu Thu Jul 24 12:28:38 2008 Date: Thu, 24 Jul 2008 12:28:38 -0700 From: Mary Simms To: rsimms@opus.cabrillo.edu Subject: Don't forget to bring pen drive I need to use it again to back up some files and practice partitioning. Thanks Mary Message 4: From simmsben@opus.cabrillo.edu Thu Jul 24 12:29:27 2008 Date: Thu, 24 Jul 2008 12:29:27 -0700 From: Benji Simms To: rsimms@opus.cabrillo.edu Subject: Bone lost Did you see that old bone I was chewing? I can't find it anywhere! - Ben mail command Various mail boxes example Print 2 messages 54
55
mail command Various mail boxes example CIS 90 - Lesson 3 & s 4 bone "bone" [New file] & h N 1 jimg@opus.cabrillo.e Sun Jun 22 13:53 21/826 "Hot days and servers" N 2 simmsben@opus.cabril Thu Jul 24 12:27 16/697 "Nisene Hike" 3 simmsmar@opus.cabril Thu Jul 24 12:28 18/728 "Don't forget to bring" >* 4 simmsben@opus.cabril Thu Jul 24 12:29 17/696 "Bone lost" N 5 rsimms@opus.cabrillo Thu Jul 24 12:33 20/808 "Re: Hot days and serv" N 6 roddyduk@opus.cabril Thu Jul 24 15:41 18/691 "Salsa" & q Saved 1 message in mbox Held 4 messages in /var/spool/mail/rsimms [rsimms@opus ~]$ mail Mail version 8.1 6/6/93. Type ? for help. "/var/spool/mail/rsimms": 4 messages 4 unread >U 1 jimg@opus.cabrillo.e Sun Jun 22 13:53 22/836 "Hot days and servers" U 2 simmsben@opus.cabril Thu Jul 24 12:27 17/707 "Nisene Hike" U 3 rsimms@opus.cabrillo Thu Jul 24 12:33 21/818 "Re: Hot days and serv" U 4 roddyduk@opus.cabril Thu Jul 24 15:41 19/701 "Salsa" & q Held 4 messages in /var/spool/mail/rsimms [rsimms@opus ~]$ mail -f mbox Mail version 8.1 6/6/93. Type ? for help. "mbox": 1 message > 1 simmsmar@opus.cabril Thu Jul 24 12:28 19/739 "Don't forget to bring" & q [rsimms@opus ~]$ mail -f bone Mail version 8.1 6/6/93. Type ? for help. "bone": 1 message 1 new > 1 simmsben@opus.cabril Thu Jul 24 12:29 18/706 "Bone lost" & q "bone" complete [rsimms@opus ~]$ save message 4 in bone messages 3 and 4 are read. 4 is saved (*) 55
56
mail command (d)elete and (u)ndelete CIS 90 - Lesson 3 56
57
mail command Copying messages from mbox back to system mail box CIS 90 - Lesson 3 57
58
mail command Forwarding a message with ~m CIS 90 - Lesson 3 This is how you forward message 5 58
59
mail command The mail boxes are all ascii text CIS 90 - Lesson 3 /home/cis90/simmsben $ cat /var/mail/simmsben From millehom@opus.cabrillo.edu Thu Jul 24 16:26:56 2008 Return-Path: Received: from opus.cabrillo.edu (opus [127.0.0.1]) by opus.cabrillo.edu (8.13.8/8.13.8) with ESMTP id m6ONQuBk016775 for ; Thu, 24 Jul 2008 16:26:56 -0700 Received: (from millehom@localhost) by opus.cabrillo.edu (8.13.8/8.13.8/Submit) id m6ONQuqw016774 for simmsben; Thu, 24 Jul 2008 16:26:56 -0700 Date: Thu, 24 Jul 2008 16:26:56 -0700 From: Homer Miller Message-Id: To: simmsben@opus.cabrillo.edu Subject: RC4 review Meeting at 4:00 today in Big Sur room. Looks like we have 2 showstoppers and need to rebuild tonight. Homer /home/cis90/simmsben $ mail Mail version 8.1 6/6/93. Type ? for help. "/var/spool/mail/simmsben": 1 message 1 new >N 1 millehom@opus.cabril Thu Jul 24 16:26 18/741 "RC4 review" & 1 Message 1: From millehom@opus.cabrillo.edu Thu Jul 24 16:26:56 2008 Date: Thu, 24 Jul 2008 16:26:56 -0700 From: Homer Miller To: simmsben@opus.cabrillo.edu Subject: RC4 review Meeting at 4:00 today in Big Sur room. Looks like we have 2 showstoppers and need to rebuild tonight. Homer 59
60
CIS 90 - Lesson 3 Class Exercise UNIX mail Ask your neighbor for some email if you need some more messages Save a couple of messages to a file named in2008 Forward a message to one of your classmates Send a message to yourself Delete and undelete some messages Experiment with q (quit) and x (exit) to see how read messages are handled Use mail with –f option to read mbox and in2008 mailbox files Check out your mail boxes with file and cat commands Your system message store: /var/mail/username Your archived message : mbox The file you saved messages to: in2008 60
61
CIS 90 - Lesson 3 end-to-end email 61
62
end-to-end email CIS 90 - Lesson 3 compose and send message open and read message 62
63
end-to-end email CIS 90 - Lesson 3 compose and send message open and read message MTA Mail Transport Agent MTA Mail Transport Agent MUA Mail User Agent MUA Mail User Agent DA Delivery Agent Message Store AA Access Agent 63
64
end-to-end email: example Implementation CIS 90 - Lesson 3 compose and send message open and read message MTA sendmail MTA sendmail MUA /bin/mail MUA Yahoo Mail DA procmail Message Store /var/mail/rsimms AA spop SMTP Simple Mail Transport Protocol SMTP Simple Mail Transport Protocol POP Post Office Protocol 64
65
end-to-end email: configuring your MUA (Mail User Agent) CIS 90 - Lesson 3 MTA Mail Transport Agent DA Delivery Agent Message Store AA Access Agent This is why you get asked for the SMTP server and the POP3/IMAP server when you set up email on your PC. Your MUA needs to know this to send and receive messages. SMTP Simple Mail Transport Protocol SMTP Simple Mail Transport Protocol POP Post Office Protocol MTA Mail Transport Agent Example MUA: Windows Mail (on Vista) 65
66
CIS 90 - Lesson 3 Other MUAs MTAs, DAs, AAs 66
67
end-to-end email some of the many players CIS 90 - Lesson 3 MTA MUA DA AA sendmail, Exim, Microsoft Exchange Server, Postfix /bin/mail, procmail, smrsh imapd, spop /bin/mail, pine, elm, Outlook, Eudora, Thunderbird, Evolution 67
68
CIS 90 - Lesson 3 Wrap up 68
69
CIS 191 - Lesson 3 New commands: mail- UNIX mail ?print these commands p print messages ngoto and print next message e edit messages d delete messages s filesave (append) messages to file u undelete messages R reply to sender(s) r reply to all m mail to specific users q quit, saving read messages to local mbox file x quit, mark all mail as unread and undeleted. h print out active message headers mesg- Enable or disable writes to your terminal write- Write message to another user New Files and Directories: /var/mail- Message store for mail /var/mail/username- Incoming mailbox for username mbox- File in users home directory where read messages are archived to 69
70
CIS 90 - Lesson 3 Next Class Assignment: Check Calendar Page on web site to see what is due next week. Quiz questions for next class: What command can you use to "chat" with another user? How do you forward a message with /bin/mail? With /bin/mail, where do all messages that have been read go after using the quit command? 70
71
CIS 90 - Lesson 3 Backup 71
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.