Home
CIS 90 - Lesson 10
Contents
1. W Proce anc Log Flea Imtmert Seri ge lat Pe avert sf oe pen uro rtu STOTT Yen Tema w rerai er i Pit mme unt r Lt A EE Rar t Hai ed ws Quen Pl Ay er Puoi OK Carme Am Udo adult cers eil deleto le m rm fesso ttn 12 CIS 90 Lesson 11 A I ru Sound Check Students that dial in should mute their line using 6 to prevent unintended noises distracting the web conference Instructor can use 96 to mute all student lines 14 Instructor Rich Simms Dial in 888 886 3951 Passcode 136690 Bejn n A E lance Mi Email me risimms cabrillo edu a relatively current a of your face for 3 points extra credit CIS 90 Lesson 11 d iz ru First Minute Quiz Please answer these questions in the order Shown Use CCC White email answers to r simms cabrillo edu answers must be emailed within the first few minutes of class for credit 1G CIS 90 Lesson 11 Fk IY iii vi editor Objectives e Create and modify text files e Quiz e Questions e est 2 Post Mortem e Housekeeping e grep workout e Shell Six Steps review e Signals review e Target Practice e Using amp e Job control review e Load balancing amp scheduling review e Text editors evi 101 e VI e Tangent on spell e Assignment 17 e Wrap up Questions A NA Mege LIEN Questions 3 S exe Lesson material Labs Tests How this course wor
2. icon If white Start Sharing text is present then click it as well 2 Click overlapping rectangles CIS 90 Lesson 11 Whee User Accmumt Contro UAC ms enabled an Vista App cston Shaig i Backbonrd Collaborele may be hastas wth other dlandard oy evated privfeges Elevated priwioges ore requeed va Dare applications that wee elewnted prrideges Eieuanad prvieges are ecqures via Tost gt Appicaton Shanng Rom Dwvated Prideqes They can be retergussted via Toots gt App cation Shanng gt Yd Slevated Priv oges returning you te standard pgrreisgen Y you are hosting on appricamon Dain Sekt wth stadrd privileges and you ar parsos remotely cormrolng your desktop ar application pertann an action thal requres elevahed provdeqes Vista wel prompt pou for consest wa UAC consent dialog Tha wf couse te application share session to terrmete Alm wiring severed privileges sharing of apsbcaboss val requis more hedt OPU tme than sharing the desidop all of amp or a region F you are heating an application sharing session wth aka privileges on pou perform an action thet remeras elevated pitileges Veta wil hot arompt you for Dora Aati the eon automatically will be ether denied f you are legped on oe a standard user ot skred if yau are logged on se an Strreresy ator Never ation tm taisg gen 3 Click OK button Select your desktop or ae open npphcation you would Ia to share W Microsoft Word wimvord e
3. CIS 90 Lesson 11 Rich s lesson module checklist DOO 00000 UUUUUU OULU Slides WB converted Print out agenda slide Flash cards Page numbers 1st minute quiz Web Calendar summary Web book pages Commands Lab tested and uploaded Tech file email for Lab 9 ready Lock unlock turnin directory Apache configured for student websites Test s 2 copied to test archives folder on Blackboard Materials uploaded Backup slides CCC info handouts on flash drive Spare 9v battery for mic CIS 90 Lesson 11 Shell commands Permissions Secure logins Navigate Welcome to CIS 90 Scheduling i ne En Files and es Introduction to ns Mail vi editor Environment Run variables programs scripts Filters Pipes Student Learner Outcomes 1 Navigate and manage the UNIX Linux file system by viewing copying moving renaming creating and removing files and directories 2 Use the UNIX features of file redirection and pipelines to control the flow of data to and from various commands 3 With the aid of online manual pages execute UNIX system commands 2 from either a keyboard or a shell script using correct command syntax CIS 90 Lesson 11 Introductions and Credits Jim Griffin Created this Linux course Created Opus and the CIS VLab e Jim s site http cabrillo edu jgriffin Rich Simms HP Alumnus e Started teaching this course in 2008 when Jim went on sabbatical Rich s site http simms
4. Subject Good Bones Hey Homer I really appreciate thatbone you sent me last week Let me knwo if you want to go mark some fench posts this weekend Later Ben You are composing a message and you spot some typos CRUD what can you do 127 CIS 90 Lesson 11 bin mail and vi home cis90 simben mail milhom90 Subject Good Bones Hey Homer I really appreciate thatbone you sent me last week Let me knwo if you want to go mark some fench posts this weekend mM Later Ben Well you could try the v command 128 Kes CIS 90 Lesson 11 est 1959 m gt simben90 oslab ES I really appreciate that bone you sent me last week Let me know if you want to go mark some fencB posts tmp ReJZQRnV 6L 143C written The message is loaded into vi where changes or additions can be made wq is used to save and quit vi 129 CIS 90 Lesson 11 E 11 ru bin mail and vi home cis90 simben mail milhom90 Subject Good Bones Hey Homer I really appreciate thatbone you sent me last week Let me knwo if you want to go mark some fench posts this weekend Later Ben MV Continue BOT home cis90 simben The earlier text with typos is still Showing however the corrected version is what is actually sent 130 Ca oed CIS 90 Lesson 11 nA 4 11 pru bin mail and vi home cis90 milhom mail Heirloom Mail version 12 4 7 29 08 Type for help var spool mail milh
5. Pepe Layent Beqnumn ain Pour IL y son if ia IM l oou kur ISi 1 pe ac AaBbC eme TT NS Tp 91 Fa EME Es au Au Nw Bo Hs fwrewwrt Lhange Peers pe IS 90 Linux Lab Exafcikseo mn editing files with v pring z012 Lab 9 Editing Fles with vi In this lab you wil use the wi editor to creste new files and edit existing fres torum Browse to Dito opus Cabrio edu gnum vef onam php if 246 Check the fone for any lee Arason mms out fees Lan The fenum Le Alan The clare hs o 4 ser ne f ER RA Am m eee Word processors allow a rich set of formatting fonts sizes styles color and graphics to be added to documents Lesson 11 it 8 Fs 1 then echo usage 0 username exit 1 fi username 1 homedirname username 90 Strip 90 off the end file submitted Susername report graded Shomedirname name cat etc passwd grep Susername cut f5 d first echo Sname cut fi d r Sfile echo file not found exit 1 o Grading Test0i for Sfirst Susername Text editors use color to show the language syntax 101 CIS 90 Lesson 11 102 On Opus we are actually running VIM home cis90 simben type a vi vi is aliased to vim vi is bin vi home cis90 simben type vim vim is hashed usr bin vim History he original vi code was written by Bill Joy for BSD Unix Bill Joy co founded Sun Microsystems in 1982
6. i CIS 90 Lesson 11 CIS 90 Lesson 11 E TL Some perfect times to use the grep command 1 To search through the output of a command for some text command grep text string 2 To search inside one or more files for some text grep text string filel file2 fileN 3 To search recursively inside all files in a branch of the UNIX file tree for some text grep R text string directory 33 CIS 90 Lesson 11 A 11 pru grep usage search output of a command Is the CUPS daemon print service running right now home cis90 simben ps ef grep cups root 1 0 Jul31 00 00 04 cupsd C etc cups cupsd conf simben90 27027 26966 0 08 47 pts 3 00 00 00 grep cups Yes it is with PID 6251 34 CIS 90 Lesson 11 grep practice _Is the cronjob daemon crond running right now If so type the crond PID into the chat window 35 CIS 90 Lesson 11 E 11 bi grep usage search output of a command Is the Apache web server httpd installed This shows all installed This searches for package package names N Z names containing httpd home cis90 simben rpm qa grep httpd httpd tools 2 2 15 47 el6 centos 1686 httpd manual 2 2 15 47 el6 centos noarch Yes version 2 2 15 has been installed 36 CIS 90 Lesson 11 I LA l EAN i gt x 7 N M grep practice Has the mysql server package been installed on Op
7. vi for visual vim is an enhanced version of vi 103 CIS 90 Lesson 11 home cis90 simben home cis90 simben vi dogbone Type this 104 CIS 90 Lesson 11 n at at dogbone New File Take your hands OFF THE MOUSE don t use it in vi 105 n at at dogbone New File Keep your hands OFF THE MOUSE don t use it in vi 106 CIS 90 Lesson 11 n at at F4 zi LA rj a 1 I Keep your hands OFF THE MOUSE don t use it in vi 107 CIS 90 Lesson 11 est 1959 S Very carefully type these five lines EP simben90 opus u n What is your name NAME n What is your favorite bone BONE Hi SNAME your favorite bone is SBONE a mn mn mn mr m nt mn a a I F4 zi Ly t x ux I Keep your hands OFF THE MOUSE don t use it in vi 108 CIS 90 Lesson 11 est 1959 S Have your neighbor check that your five lines are PERFECT EP simben90 opus n What is your name NAME n What is your favorite bone BONE Hi SNAME your favorite bone is SBONE mt mt mt mr mt mt mt mr a m Pr I zi Ln n a3 FJ Keep your hands OFF THE MOUSE don t use it in vi 109 CIS 90 Lesson 11 est 1959 Tap the esc key EP simben90 op
8. Child process has stopped or exited changed POSIX Continue executing if stopped POSIX Stop executing can t be caught or ignored POSIX Terminal stop signal POSIX Ctrl Z or Ctrl F Background process trying to read from TTY POSIX Background process trying to write to TTY POSIX Urgent condition on socket 4 2 BSD CPU limit exceeded 4 2 BSD File size limit exceeded 4 2 BSD Virtual alarm clock 4 2 BSD Profiling alarm clock 4 2 BSD Window size change 4 3 BSD Sun I O now possible 4 2 BSD Power failure restart System V Use kill I to see all signals 71 CIS 90 Lesson 11 Ern pu Signals E Signals are asynchronous messages sent to processes They can result in one of three courses of action 1 be ignored 2 default action die 3 execute some predefined function Signals are sent Using the kill command kill PID Where is the signal number and PID is the process id e if no number is specified SIGTERM 15 is sent r asus Using special keystrokes pi limited to just a few signals limited to when you have control of the keyboard Use kill I to see all signals CIS 90 Lesson 11 Target Practice CIS 90 Lesson 11 Activity 1 Run the annoy program 2 Try sending it a SIGINT with Ctrl C 3 Try sending it a SIGQUIT with Ctri 4 Bring up another terminal and try signals 1 through 64 Use ps u SLOGNAME to find the anno
9. ESTE DNI NB NRI jmd IET 3 PS1 u h l NW NNS home cis90 rodduk It is set more than once during login We will learn in a future lesson that the one in bash profile is done last and is what you end up using 46 CIS 90 Lessord 41 pw grep usage search inside files in all or part of the file tree This time in color using color option P rodd uk90 oslab home cis90 rodduk grep R color PSi etc bash SHOME 2 dev null etc bash completion d git PSi u h NWS git ps1 s J etc bashrc SPSi s v S gg PS1 u h NW NNS etc bashrc PSi u h l WI S home cis90 rodduk bash profile PSi SpwD home cis90 rodduk S i 47 CIS 90 Lesson 11 3 DW L A A pA u grep practice Find the file in the usr lib portion of the file tree that contains hot pototo dance yes potato is misspelled Type the absolute pathname of the file in the chat window 48 Shell SIX Steps REVIEW CIS 90 Lesson 11 est 1959 S Example Command home cis90 simben find name treat 2 dev null home cis90 primic treatl home cis90 juetay treatl home cis90 porjos treatl home cis90 beycha bag treatl home cis90 drydan bag treatl home cis90 rodduk treatl home cis90 tosbre treatl Note Benji has a file home cis90 remlis treatl home cis90 brevic treatl home directory snipped home cis90
10. My Mem later Sing Contact Us Order n C PO STARO PRESS VER frs am gank eontertatemint Hydratio harmony Chck on the mage to retam to Mug of VI man gage FILE CLM MANES re mimim m tn 1 Mx edita tike or Glee te i wn 1 i ht ve MEKI peeves EMTEC 3 F Mi nao rares sand Ale after crash ct delete re une vo prione poraga IL woo see and est Jelrte chart beard van area Gerwerd hack ane wee a cal gut quit wrihet zareag dele Y ms m coul of cumst our max a m eave Ele sure Als on fu tft t r tuf tet adado PASTE g ninm edit ce cuam lh y T inpr v ines Copyright copy word be s text wiih Wank lini poste war an am cmd La sett sew line below aln amt rexr aflei peewete omo amd naar var pur current bre ment text pe LE AR AND NEFLACI T unde list yhing K DOL STUPI 7 hod At formant or bockward repeat lasi change SHENJE 528 bed pat line them starts ani runepoee i haraetere IA 40 DNAN AHL vith tnt v6 m es lint wei line cestui hee we Done feqeeat leet arch hache fA L 3 Daft cule un deum ives create a mask called p lou pl sap uw lef tia he wins Hun r od tegime tens bt i n CTRL back furwand owe sci c N delete copy tex from mark tu oe muerte P bat oc tre CTRL un up dowt tit warren urn ibalent h lene http nostarch com mug htm CIS 90 Lesson 11 bin mail and vi home cis90 simben mail milhom90
11. en ne Mie mom ww na I Are or cmm mad emm nt con oom Ion De Pm nmm medo t or res en td ert pre emm om nad o y Jmm A m Aa qw y u mam pryw an mn prs Qm vin hag a etn Leer One i e ae er nib Rio MAMAS en P SN at 4pm Sree To oe PRECIO NS pet mre ir de she err M en D ed Goma at home rsimms cis90 1abO9 mail tech all at lt Ctri d gt oF D 0 77 479 Rp VAR opu ae b Emmen 4 roa 7 Thiet lt lt ui TH li em mes mit ms mt matt rn 141 CIS 90 Lesson 11 New commands Vi Run vi editor New Files and Directories na na 143 CIS 90 Lesson 11 l pu Next Class Assignment Check Calendar Page on web site to see what is due next week Quiz questions for next class How do you send a SIGKILL to one of your own processes e What vi command is used to exit vi without saving any of the changes you made e What vi commands are used for copy and paste 144 Backup m LX Ww est 1959 The mystery est eg CIS 90 Lesson 11 Signals Special keystrokes S stty a speed 38400 baud rows 26 columns 78 line 0 intr C quit N erase kill U eof D eol lt undef gt eol2 lt undef gt swtch lt undef gt start Q stop S susp F rprnt R werase W lnext V flush O min 1 time 0 rsimms opus stty a speed 38400 baud rows 39 columns 84 line 0 intr C q
12. home cis90 simben vi myletter COMMAND mode D rrberOBpur br Mother Melle Fa i cr Here I am ac Camp Granada Things are very entertaining and they say we 1l have some fun when it stope raining All the counselors hate the waiters and che lake das mlligetcrs You remember Leonard Skinner Me gor rtcmaizna pociscting last night aftes dinner stow I don z want this to sesre you Dut my bunk mate bas malaria You cemenmber Jeffrey Hardy Theis about tc porganiac a searching party ch Mother Father take me boss hate Granada n t leave me out in the forest where I might get caren a bear Take me bore I promise that I won t make noise She house with other boys ch plasse dczn t make me I ve been here one whole day Despart Father darling Mothers Sox s my precious little Dzorher I will come home if yoo mise se I will even lez Aunt Sertha hug and kiss me l ayiatter 20 1050C INSERT mode nmb opus P tel SEE Mother Melle Father Here I am ac Camp Granada Things are very encertaining and they say we ll have some fun when it stope raining All the counselors hate the waiters and the lake das alligetcrs You remember Leonard Skinner Me gor Stemaine pciscting last night after dinner pow I dun r want this to sOCsre you bur my bunk mate bas laria You rwzamber Jeffrey Hardy Theis about tc Lorganize a searching party ch Mother Father tate me boee hate Granada nt leave me o
13. 0 Lesson 11 n 2 11 ru Job Control Managing jobs S bg 2 S Jobs S bg 1 o Jobs home cis90ol simmsben fg 3 sleep 100 Let s resume job 2 in the background sleep 120 sleep 110 amp sleep 100 Let s resume job lin the background sleep 120 amp sleep 110 amp sleep 100 Let s resume job 1 in the foreground At this point we lose control of the keyboard again until sleep 100 is finished 92 CIS 90 Lesson 11 Job Control Managing jobs home cis90ol simmsben Jobs 1 Done sleep 120 Background jobs are 2 Done all done sleep 110 93 Load Balancing amp Scheduling Review CIS 90 Lesson 11 Load Balancing The at command e reads from stdin for a list of commands to run e runs those commands at the specified time Any output from those commands will be emailed Use atq and atrm to manage scheduled commands Use at to schedule commands to run in the future 95 CIS 90 Lesson 11 Load Balancing Managing queued jobs at now 5 minutes at now 1 hour Ways to specify future times at 7 58AM at 7 47PM 11 25 2014 at teatime 96 CIS 90 Lesson 11 S 11 ru home cis90 simben Zo 20 LL A 28 2011 22 12 2d ZU Teller 2 ZU peers 24 ZU Let esl home cis90 simben home cis90 simben Zo 2 12 17202 20 aU eee 27 zu Le 20 2012 1 1 12 home cis90 simben atq 14 09 Dos 12210 1 6200 12 14 D o o o o atrm atq 14 0
14. 0 remlis treati home cis90 linmay treat1 home cis90 brevic treat1 snipped Options name treati Args directory contents are read using the kernel dev null stdin find lost found Permission denied stderr find var empty sshd Permission denied find var log sssd Permission denied lt snipped gt CIS 90 Lesson 11 Ser Kk in A process Is provided with parsed expanded options and arguments from the shell e may read from stdin e may write to stdout e may write error messages to stderr and may get interrupted from time to time by a signal The find process is running 65 CIS 90 Lesson 11 ER 11 pw Nap Step 1 Prompt 2 Parse 3 Search 4 Execute 5 Nap 6 Repeat CIS 90 Lesson 11 E R f Nap Step PID 1570 PID 1570 PPID 1476 PID 1476 The PS command shows Benji s find command is running as a child process while the parent bash shell sleeps PPID 1475 PPID 1475 Sleeping rsimms oslab ps 1 u simben90 E xS ULD PID PPID PRI NI ADDR SZ WCHAN TTY TIME CMD 5 S 1001 1475 1470 0 80 0 3392 00 00 00 sshd 2 0 1001 1476 1475 0 80 0 1308 pts 1 00 00 00 M 0 1001 1570 1476 40 80 O 1179 pts 1 00 00 00 finde _ Child 68 Running CIS 90 Lesson 11 Ern 11 9H AF C4 2 i T System Commands Applications Kernel Repeat Step 1 Prompt 2 Parse 3 Search 4 E
15. 0 roddyduk edits type spell spell is hashed usr bin spell home cis90 roddyduk edits file usr bin spell usr bin spell Bourne shell script text executable home cis90 roddyduk edits cat usr bin spell bin sh aspell list mimicks the standard unix spell program roughly OK the actual per og list mode none sort u BR command is aspell home cis90 roddyduk edits 135 Ca eg CIS 90 Lesson 11 E 11 pru spell command ASPELL 1 Aspell Abbreviated User s Manual ASPELI 1 NAME aspell interactive spell checker SYNOPSIS aspell options lt command gt DESCRIPCION aspell is a utility that can function as an ispell a replacement as an independent spell checker as a test utility to test out Aspell features and as a utility for managing dictionaries COMMANDS lt command gt is one of help display the help message c check file to spell check a file There must be a way to add CIS but lets try google 136 CIS 90 Lesson 11 est 1959 m Nn Ahead wi bee e Pree omm your ren parue Z e Q O biogsamatorn nri o 2 Iz Dumm WG msn t LA LAS OG VOU NAOC Creating your own personal aspell dictionary Noces 2 2008 4 230 Somestung Mat nas bothered ex foirar is boc acci cane rs TAM use GIU Axe for spes i es kept makna my name az a mes mamas k Aamir a ie ou KMaih Most front end appic Mors dont promo a way for you Iu add your ow
16. 00 00 00 bash 1465 pts 0 00 00 00 firefox Ar http start ubuntu com 1 v v a 1470 pts 0 00 00 00 run moz B 1474 pts 0 00 00 01 firefox Most Visitedv o Getting Started Latest Headlines v 1489 pts 0 90 08 08 ps Ubuntu Start Page Gin 7 cis90 eko ES After running Firefox in the background it is 6 still possible to enter more commands G OL gle Search v Done TI C cis90 eko Update Manager Ubuntu Start Page Mo ja 83 CIS 90 Lesson 11 R i p amp append to a command to run it in the background Example 1 home cis90 simben grep r pototo usr opt 2 dev null t ccc EE NS prompt For long running commands or scripts you must wait for the command to finish before you type more commands Example 2 home cis90 simben grep r pototo usr opt 2 gt dev null amp Be enge home cis90 simben date Tue Apr 15 14 43 09 PDT 2014 Hit enter to get the prompt and continue working while the find command runs in the background CIS 90 Lesson 11 FE l pa Job Control A feature of the bash shell amp Append to a command to run it in the background bg Resumes a suspended job in the background fg Brings the most recent background process to the foreground jobs Lists all background jobs Use Jobs bg fg to list and resume Jobs in the foreground or background 36 CIS 90 Lesson 11 Job Control A fe
17. 1959 F1 i E x Le 2011 x Rich s CCC Confer checklist Elmo CCC S Confer 3 w nn A Image Mate x euere The rotate image oe button is necessary S666 a T I grove AME enam 80 white board om em ou Quite interesting that they consider ou to be an Elmo rotated down to view side table y expert in order to use this button VE image image Mate Rotate image button Elmo rotated up to view white board mage image Mate Rotate image button ELMO Run and share the Image Mate program just as you would any other app with CCC Confer ELMO 11 CIS 90 Lesson 11 est 1959 m 5 ccC E Confer Rich s CCC Confer checklist universal fix Universal Fix for CCC Confer 1 Shrink 500 MB and delete Java cache 2 Uninstall and reinstall latest Java runtime 3 http www cccconfer org support technicalSupport aspx Control Panel small icons General Tab gt Settings 500MB cache size Delete these d fem mue my Mes et m sed p ima Conte Pase rn kenn h xiosty ree Locate Gelect Oe booten eters wmporws fer oe bere Wah Sere Rect ety m rm Se Jers Deer he u Te W Catan Aug nare anz Ag ete amont satire me mu when mere lotes comertors fy cmd uos well Oh Soe Ape Oa rate werten m cs wet beers Orte ham Leurs sod rodh netu ed Acorn and Nopiete eat e reono wes te AA Miss Wve ee o9 ne
18. 9 a 03 00 a 12 10 a 16 00 a jobs Load Balancing Managing queued jobs simben90 simben90 simben90 simben90 simben90 24 simben90 simben90 simben90 simben90 The atq command lists jobs queued to run in the future The atrm command is used to remove jobs from the queue Note The jobs command lists processes running or suspended in the background and is NOT used for at commands 97 CIS 90 Lesson 11 R i I i Load Balancing Try it yourself with your own terminal device and username rsimms oslab tty dev pts x Ec NI MAECEN DAE TY These should match rsimms oslab S at now 2 minutes at gt echo Take Benji for a walk mail s walk the dog SLOGNAME at gt echo Read your mail gt dev pts x auo Onl gt OD LE are 2 D ETAT ni 2 rsimms oslab atq 11 dal be A TA ORDRA ch siete arn ae iS imma rsimms oslab Type what happens in the chat window 98 text editors CIS 90 Lesson 11 N 11 pw There are lots of text editors Windows notepad P Text editors and word processors are notepad HIER textpad I eren Mac Word processors are used by many different people to create documents TextWrangler id 3 containing text and graphics Linux gedit e Text editors are used by programmers emacs to develop software and web designers nano to create web sites Vi jove Thanks Maria 100 CIS 90 u Moast Mod ron ranrenid as
19. CC Confer 0 RIC O1 File Edit View Tools Window Help i na nn Ban foxit for slides Q1 What comri e eme lother users logged in to the computer A1 chrome Q2 What environment variable is used by thA shell to determine which directories to search when locating a command A2 EEE w PARTICIPANTS Q Rich Simms See T MAIN ROOM 3 Qt 5 LE Ke B Rich Simms i Welcome 182 E JR url e Mach der mba Dord Aim fe Ww Teleconference 1 Serving Cab B What command copies E pt em zu Terminal type ET eg Terminal type is as x U z home cis90 simbe 70 AM Teleconference joined the Main Room 5 51 AM s LL lelel 6 a2 ej z e mn layout and share apps e 9 CIS 90 Lesson 11 CCC Confer 0 RICH SIMMS File Edit View Tools Window Help Application Sharing Audio b Breakout Rooms b New Page Delete Page Chat d Graphing Calculator In Session Invite gt Interaction gt Moderator d Video webcam Polling Profile Make Video Follow Moderator Focus Recorder A PARTICIP Session Plan Rich Telephony Moderate Timer wi Video Camera Settings Whiteboard Maximum Simultaneous Cameras MAIN ROOM 1 ST SE SA ho Make Video Follow Moderator Focus 2 Rich Simms 9 Mod ralur You Make Video Follow Speaker Send Camera Snapshot To Whiteboard 10 est
20. CIS 90 Lesson 11 vi Kk in A process Is provided with parsed expanded options and arguments from the shell e may read from stdin may write to stdout e may write error messages to stderr and may get interrupted from time to time by a signal A process is a program that has been loaded into memory and is either running executing instructions or waiting to run CIS 90 Lesson 11 Signals The result of pepe DIE sen ding process gets signal 20 signal to a SIGTSTP process e be ignored e default action die e execute some predefined function 75 SIGHUP SIGINT SIGQUIT SIGILL SIGTRAP SIGIOT SIGBUS SIGFPE SIGKILL SIGUSRI SIGSEGV SIGUSR2 SIGPIPE SIGALRM SIGTERM CIS 90 Lesson 11 Signals Hangup POSIX Terminal interrupt ANSI Terminal quit POSIX Illegal instruction ANSI Trace trap POSIX IOT Trap 4 2 BSD BUS error 4 2 BSD Floating point exception ANST Kill can t be caught or ignored POSIX User defined signal 1 POSIX Invalid memory segment access ANSI User defined signal 2 POSIX Write on a pipe with no reader Broken pipe POSIX Alarm clock POSIX Termination ANSI Ctrl C Ctri Use kill I to see all signals 76 CIS 90 Lesson 11 X LE SIGSTKFLT SIGCHLD SIGCONT SIGSTOP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGXCPU SIGXFSZ SIGVTALRM SIGPROF SIGWINCH SIGIO SIGPWR 16 Signals Stack fault
21. Lesson 11 b 4 l p Entering SERT mode From COMMAND mode i Ready to insert characters immediately before the current cursor position I Ready to insert characters at the start of the current line a Ready to append characters immediately after the current cursor position A Ready to append characters at the end of the current line o Ready to input characters in a new line that opens up below the cursor O Ready to input characters in a new line that opens up above the cursor 121 CIS 90 Lesson 11 VI Cut Copy Pasting Commands Use in COMMAND mode x Deletes the current character r Replace the current character with the character you type next dw Deletes the current word dd Deletes the current line D Deletes to the end of the line yy Copies a line to the clipboard buffer p Pastes whatever is in the clipboard buffer below the current cursor P Pastes whatever is in the clipboard buffer above the current cursor 122 CIS 90 Lesson 11 Kk l pu VI Miscellaneous Useful Commands Use in COMMAND mode g Tells you the filename you are editing and what line your cursor is on u Undoes the last command you executed Ar Undo the undo redo Repeats the last command you executed string Searches for the string of characters in the file n Finds the next occurrence of the current search string looking down the file N Finds the next occurrence of the current search string looking up the file Changes the case
22. O 2460 INE co 2491 1165 1061 149 X CIS 90 Lesson 11 Signals Jim s app script P rsimms opus home cis90 depot ue Be e bin sh app script to demostrate use of signals Usage run app with no options or parameters Send signals to it with keystrokes or kill command Notes stty echo stop the display of characters typed stty echo makes typed characters visible again stty susp Z sets suspend keystroke to Ctlr Z to stop forground processes M stty susp sets suspend character to to stop foreground processes F trap 2 lIgnore SIGINT trap echo n quit it 3 Handle SIGQUIT trap stty echo susp Z echo ee echo cleanup exit 15 Handle SIGTERM clear banner testing stty echo susp NC This is why Ctrl F suspend stopped working and we had to use Ctrl Z V0 CIS 90 Lesson 11 XC Kk pu Tangent on Dg and SIGCONT CIS 90 Lesson 11 Running process gets a signal What is signal 18 CIS 90 Lesson 11 x AE pw Signals SIGSTKFLT 16 Stack fault SIGCHLD 17 SIGSTOP 19 SIGTSTP 20 SIGTTIN 21 SIGTTOU 22 SIGURG 23 SIGXCPU 24 SIGXFSZ 25 SIGVTALRM 26 SIGPROF 27 SIGWINCH 28 SIGIO 29 SIGPWR 30 Child process has stopped or exited changed POSIX Stop executing cant be caught or ignored POSIX Terminal stop signal POSIX Ctrl Z or Ctrl F Background process trying to read from TTY POSIX Background process trying
23. ature of the bash shell When a process is running status R the user can stop it status T and choose whether it H Running in runs in the background or d foreground Background Stopped 87 CIS 90 Lesson 11 Job Control A feature of the bash shell Command Command amp Running in Foreground Ctri F CIS Ctrl Z Running in Background Stopped Use the jobs command to view stopped and background jobs 90 students everyone else 88 Cal org CIS 90 Lesson 11 R i I i Job Control Find out with keystroke combination is configured to suspend a process home cis90ol simmsben stty a Speed 38400 baud rows 24 columns 80 line 0 intr C quit N erase kill U eof D eol lt undef gt eom lt undef swrehl under gt etre NO 2S5top Ba SUSP F OAM R werase W lnext V flush O min 1 time 0 Date ee ner odd es BI ae ae paapa cred TONES em tse eom PO MONK 4 ADIL nui OI DAT FOA EMEK o cen DER fra Ser Loe QURC REIN EB ern RX ORES Xx O tf iuclc ixany imaxbel iutf8 OpOeBi c otcuc ociaznlipon dicrp9 onmocrimsonibiset ofvl ofdelundl0 erQ tab UxXbsi uv OR E 9 isig icanon iexten echo echoe echok echonl noflsh xcase tostop echoprt echoctl echoke home cis9001 simmsben In this case it is Ctrl F that will be used to suspend a process How is yours configured 89 CIS 90 Less
24. duk 1 Running home cis90 roddyduk 1 Done Note sending a 18 signal or using the bg command will sleep 60 sleep 60 ps I Co PRI NIL ADDE 524 O 76 1165 0 75 926 0 78 G EDSI jobs sleep 60 kill 18 10743 jobs sleep 60 amp ps I Co PRE NL ADDE S24 0 75 De 1163 0 85 926 O0 77 0 1050 jobs sleep 60 amp jobs sleep 60 amp jobs sleep 60 resume a stopped process WCHAN wait finish WCHAN wait 322800 LLX pts 0 pts 0 pts 0 LATE pts 0 pts 0 pts 0 Ue JO 00 00 DOT OO TIME ers 00 00 00 00 TIME EO DU 00 00 00 00 CMD bash sleep ps CMD bash sleep ps 155
25. e information see the Resources page of the website 42 CIS 30 Lesson 11 grep practice How many CIS 72 accounts are there on Opus Type the number of CIS 72 accounts into the chat window 43 CIS 90 Lesson 11 E rw grep usage search inside files Example What is my account information in etc passwd home cis90 simben grep LOGNAME etc passwd simben90 x 1000 90 Benji Simms home cis90 simben bin bash Or home cis90 simben grep simben90 etc passwd simben90 x 1000 90 Benji Simms home cis90 simben bin bash Or home cis90 simben cat etc passwd grep LOGNAME simben90 x 1000 90 Benji Simms home cis90 simben bin bash username gt C Comment Home directory Shell Group ID GID Note the field separator used H a User ID UID in etc passwd is a T password just a placeholder now CIS 90 Lesson 11 E a B dh u a 4 B D T B grep practice Does vidus user ID in 1 etc passwd match the uid output by the id command Type your answer yes or no and your uid from the id cammand into ine chat wigo 45 CIS 90 Lesson 11 x FH l ii grep usage search inside files in all or part of the file tree Where does the PS1 prompt variable get set home cis90 rodduk grep R PS1 etc bash HOME 2 dev null etc bash completion d git f PS1 u h WS git ps1 Ss Ilis etc bashre PS1 s W S 66
26. ere will be a Sunday afternoon workshop in room 828 Nov 15 2 00 PM till whenever to work through every question on Test 2 in detail The goal is for each attendee to be able to handle any of the test questions in less than 30 seconds 23 CIS 90 Lesson 11 T R f Don t wait till midnight tonight 1 Lab 8 due ton Ig ht to see if this worked Submit at 11 59pm with an earlier time at gt cat files out bigshell gt lab08 at gt cp lab08 home rsimms turnin cis90 1ab08 LOGNAME at gt lt Ctrl D gt 2 A check8 script is available for Lab 8 3 Note Lab 9 and five posts due next week 4 You can still send me your photo for our class page if you want 3 points extra credit 5 You can still do the your name in lights extra credit activity See forum for details 25 CIS 90 Lesson 11 TY 11 ru Heads up on Final Exam Test 3 final exam is MONDAY Dec 14 1 3 50PM Test 3 the final exam Extra credit en labs and Materials final posts Test blackboard aD Ag due by CCC Confer 11 59PM Enter virtual classroom Class archives e All students will take the test at the same time The test must be completed by 3 50PM e Working and long distance students can take the test online via CCC Confer and BlackBoard e Working students will need to plan ahead to take time off from work for the test 27 Cab oed CIS 90 Lesson 11 b LE pu Where to find your grad
27. es Send me your survey to get your LOR code name The CIS 90 website Grades page http simms teach com cis90grades php e Or check on Opus d 3i i periere pet da PE ee LT ta ao checkgrades codename where codename is your LOR codename l Ter FTT ur 1 2 t tele irrt we oer a T2 AT Er f 4 I id es 5 ii et hr d i mnm chant ot yf able esos a tre LE 1 E i 4 f Written by Jesse Warren a past CIS 90 Alumnus Points that could have been earned 7 quizzes 21 points 7 labs 210 points 2 tests 60 points 2 forum quarters 40 points Total 331 points grades codename where codename is your LOR codename Dr A FREE UE ELIE secta 80 to 89 9 448 to 503 8 Pas 60 to 69 9 336 to 391 D No pass At the end of the term I ll add up all Written by Sam Tindell a past CIS 90 Alumnus your points and assign you a grade Try his tips schedule and forums scripts as well using this table CIS 90 Lesson 11 H jf mmm ee P BO A A If you would like some additional come over to the CIS Lab There are student lab assistants and instructors there to help you Du aom 009 DEBE rat wan ren of ee Y Tess Michael and Paul are CIS 90 Alumni Mike Matera is the other Linux instructor i ar ME DA E Er Et if I m in there Mondays j f i
28. ffer descriptions of featured scripts Explorer to open gvim in much more flexibility and provide many features that are unavailable Vim news News from this wiki and vim org explorer mode with standard editors How to report spam fi hours aan hv lohnReckett IA d thaie mithnen Tips and tricks for VIM users 125 CIS 90 Lesson 11 The Mug of vi CUNT The Mug of Vi Mozilla Firefox _ _ lt FF e 4 PERI est 1959 A m m A bam P A TE Br D en A File Edit View History Bookmarks Tools Help G E A Y http nostarch com mug htm wes Yahoo p Disable Cookies CSS E Forms Images Information Miscellaneous s Outline s Resize P Tools ke View Sourcer re Options x Cabrillo College Home Page x w 0 unread Yahoo Mail richsimms x The Mug of Vi X gt Sams Publishing Contact Us x Ir NO STARCH PRESS H the finest in geek entertainment Home Catalog Where to buy About Jobs Media Blog Cart Custom Searel Search The Mug of Vi 12 OUNC mms ute Mattei OT E gt 2 4 P je at heavy d e jt dmm Hum fosimmie Loote Hey c vt Dogma camera beg Fre wr A 12 95 fuae Coober 1 C8 forme inger U inferruiorr Muvatieneour Outer ern 2 Yootr Li Wewfoure 7 gerne x o2 So Cable Celine Hen Ange eo we eremo ehon Mud men o P
29. ks Test 2 Post Mortem Missed Q26 15 Missed Q4 14 Missed Q30 14 Missed Q29 14 Missed Q25 13 Missed Q24 12 Missed Q28 11 Missed Q23 11 Missed Q22 11 Missed Q21 11 Missed Q20 11 Missed Q19 11 Missed Q17 11 Missed Q13 11 Missed Q11 11 1 7 tests submitted CIS 90 Lesson 1 Test 2 Resul Missed Q9 10 Missed Q27 10 Missed Q18 10 Missed Q3 8 Missed Q2 8 Missed Q1 Missed Q Missed Q Missed Q 8 1 6 1 6 8 Missed Q7 6 5 1 2 D 0 Missed Q Missed Q Missed Q14 Missed Q16 Missed Q1 0 e Ho Pg Pg Igi U1 U1 O1 Ul gt UT tests not submitted Ri AJ j s ts Extra Credit Missed Q33 13 Missed Q32 13 Missed Q31 14 SR T 21 For correct answers see test02 graded files in your home directory CIS 90 Lesson 11 i _ IS EN White Horse Q16 There is a file in the etc directory named passwd This file has information on all user accounts including usernames UIDs first and last name etc What is the absolute pathname of this file http www sodahead com united http kids britannica com comptons art 55428 General George Washington and states what color was george washingtons his staff welcoming a provision train white horse question 636725 http www mountvernon org content revol utionary war princeton white horse 22 CIS 90 Lesson 11 Questions today on Test 2 If not today th
30. lls down 10 lines Au scrolls up 10 lines f page forward one page Ab page back one page With vim not vi you can use arrow and page keys instead of these letter commands 117 CIS 90 Lesson 11 E l bi VI Moving around in a file Use in COMMAND mode Try typing a number in front of these commands and notice what happens w moves the cursor one word forward b moves the cursor one word back O zero moves the cursor to the beginning of the line moves the cursor to the end of the line G moves the cursor to the last line in the file 1G moves the cursor to the first line in the file 105G moves the cursor to line 105 118 CIS 90 Lesson 11 E 11 ru VI Saving and Quitting Use in command LINE mode W writes any changes to the file you are editing like Save q quits vi if you have saved your changes q quits vi even if you haven t saved changes wq writes and quits wq writes and quits vi even if you haven t saved changes 119 CIS 90 Lesson 11 VI Reading in and Writing out files Use in command LINE mode w filename saves your file to a new name like Save As w filename saves your file to a new name overwriting any previous data r filename reads in the contents of filename starting from the cursor position e filename replaces the current content with the content from filename s string1 string2 g replaces all stringi with string2 in the file 120 CIS 90
31. mcgcam treatl home cis90 dulste treatl home cis90 simben bag treatl home cis90 simben treatl home cis90 locjer treatl home cis90 neljoa treatl home cis90 johjos treatl home cis90 watshe treatl home cis90 hipmig bag treatl home cis90 hipmig treatl home cis90 seasky treatl home cis90 simben 51 CIS 90 Lesson 11 Ern 11 9H AF C4 2 i T System Commands Applications Kernel Prompt Step 1 Prompt 2 Parse 3 Search 4 Execute 5 Nap 6 Repeat 52 CIS 90 Lesson 11 Prompt Step uses PS1 variable C bash using your PS1 variable creates and outputs your prompt which is written to your terminal device Benji is using the bash shell There are many other shells such as sh ksh and csh In etc passwd the last field in the line for his account determines the shell that is run when logging in e The bash program resides in the bin directory The command prompt appearance is defined by the PSI variable You can output a prompt yourself using echo PS1 home cis90 simben grep SLOGNAME etc passwd simben90 x 1001 190 Benji Simms home cis90 simben bin bash home cis90 simben ls 1 bin bash rwxr xr x 1 root root 874248 May 10 2012 bin bash Do CIS 90 Lesson 11 RL D 11 pw Prompt Step Note there is an invisible lt newline gt metacharacter at the end of the command home cis90 simben Benji types this find command in response to the
32. n castor How to add words to your dictionary couuty egies your am purscnal dic onars d ndiculeus Sosy well sapor f your lingue a ENGS create a Me in you home drectry Ced asped qe pwe pazscral ws 1 1 ec z t oes TIILIMI ALTI AR UT firi red header Every cutrequent be s a wong vou wari to add ta your dicbonary can ba Fe ki i at for so long Because i5 a nice test fie syncing thes tse between machines to Lake oc un If your TM is English create a file in your home directory su called aspell en pws personal wa 1 1 en 0 Samat quasirhombicosidodecahedron Googling linux aspell personal dictionary yields this page Bingo Thank you Samat Jain 197 CIS 90 Lesson 11 i E H pu spell command home cis90 roddyduk edits ed home cis90 roddyduk echo personal ws 1 1 en 0 gt aspell en pws home cis90 roddyduk echo CIS gt gt aspell en pws home cis90 roddyduk cd edits home cis90 roddyduk edits spell text This is how you would add your own custom dictionary to be used with spell checks 138 est 1959 home cis90 simben cat edits spellk Spell Check Eye halve a spelling chequer It came w th my pea sea It plainly marques four my revue Miss steaks eye kin knot sea Eye strike a key and type a word And weight four it two say Weather eye am wrong oar write It shows me strait a weigh As soon as a mist ache is maid It nose bee fo
33. of the current character 123 Cabri Qh Cege be Copy your corrected file into the chat window when finished 124 PL J 3 Google i Rich s C 9 8 unrea Connect Q ft v http vim wikia com wiki Main_Page m wikia Gu Login CEE Edit this page Ma History f Share this article Article Discussion Redirected from Main Page nappy town TE m TONIGHT 1019c abc Welcome to the Vim Tips wiki This wiki is about the editor Vim We aim to exchange tips and tricks with other Vim users Please help by improving or adding comments to Community portal any tip Prio If you are new to Vim we have plenty of tips that will help you get Top content started Search this wiki Home Folding category We are currently editing over 1 592 articles AEA REY About this wiki amp Create a new article a New tips Upload a new image Policies and how to edit Recentchanges Random page a Discussions and asking questions Help Special pages Create a new tip zi a Vi F ode IRC ileal Information 1 592 articles on this wiki Featured tip for April view archive Vim documentation Links to guides books Folding tutorials and information on other sites 5 hours ago by JohnBeckett We all know what a tab page is each tab holds a different file Vim scripts Recent changes and Right click in Windows Actually Vim tabs are nof like that Instead tab pages in Vim o
34. om90 157 messages 5 new 155 unread gt N157 Benji Simms Mon Nov 10 14 05 25 952 Good Bones amp 157 Message 15 7 From simben90 oslab cis cabrillo edu Mon Nov 10 14 05 20 2014 Beturn Paths sSumben908BoslaD crs coabrillo edu From Benji Simms lt simben90 oslab cis cabrillo edu gt Date Mon 10 Nov 2012 14 05 20 0800 To milhom90 oslab cis cabrillo edu Subject Good Bones User Agent Heirloom mailx 12 4 7 29 08 Content Type text plain charset us ascii Status R Hey Homer I really appreciate that bone you sent me last week Let me know 1f you want to go mark some fence posts this weekend Later Benji The message Homer reads has all the typos fixed amp 131 est 1959 n OMA g Fix an email message before sending In vi Use i to enter insert mode e make changes save with Esc wq 132 BER F Ha A langent on Spell CIS 90 Lesson 11 spell command home cis90 roddyduk edits cat text Welcome to the CIS 90 class home cis90 roddyduk edits spell text CLS spell command flags CIS as misspelled word How can we add CIS to the dictionary 134 CIS 90 Lesson 11 x 4 bi spell command home cis90 roddyduk edits cat text Welcome to the Cis 20 class 1 How can we add CIS home cis90 roddyduk edits spell text to the dictionary E home cis90 roddyduk edits man spell Hmmm No man page No manual entry for Spell for spell 222999999999 home cis9
35. on 11 s 4 11 pru Job Control Managing jobs home cis90ol simmsben sleep 120 Lets start up 3 sleep Ctrl Z or Ctrl F to suspend process commands and suspend T LZ hE RD es dic each of them home cis90ol simmsben sleep 110 Ctrl Z or Ctrl F to suspend process Note The sl cep 2 Stopped pleco 110 command is a simple way to run a command nome cis9001 simmsben sleep 100 that will take awhile to Ctrl Z or Ctrl F to suspend process 3 Stopped sleep 100 finish home cis90ol simmsben jobs sleep 120 will last 120 1 sleep 120 seconds before it is ee sleep 110 finished Low sleep 100 90 CIS 90 Lesson 11 Job Control Managing jobs home cis90ol simmsben Jobs 1 Stopped sleep 120 izZ Stopped sleep 110 3 Stopped sleep 100 home cis90ol simmsben ps 1 B S5 UID PID PPID C PRI NI ADDR SZ WCHAN TTY OS 1082 5364 5363 0 75 O 1168 wait pts 2 0 1082 5452 5364 Q 75 D x 929 finish pts 2 0 1082 5453 5364 0 75 D e 929 finish pts 2 0 1082 5454 5364 Q 75 D 929 finish pts 2 O R 1082 5459 5364 0 77 0 1054 pts 2 Note all three processes are sTopped O03 QUE 00 QUE OD TIME 00 00 00 00 00 OO OO OO OO OO CMD bash sleep sleep sleep DS 91 home cis9001 simmsben 2 sleep 110 amp home cis90ol simmsben 1 Stopped 2 Running 3 Stopped home cis90ol simmsben 1 sleep 120 amp home cis90ol simmsben 2 Running 3 Stopped CIS 9
36. re two long And eye can put the error rite Its rare lea ever wrong Eye have run this poem threw it I am shore your pleased two no Its letter perfect awl the weigh My chequer tolled me sew home cis90 simben spell edits spellk chequer CIS 90 Lesson 11 Le R pu How would you add chequer the British spelling to your personal dictionary Copy the commands used into the chat window when finished 139 CIS 90 Lesson 11 oS canal PIS qm wi ecran 4 Ab AUNE y CET Y Darei ea a Lies boues SES HT 2 Ex t aS yt SLR ges E P ws is Lu acer Ma iint gt 1 Fu re le t estu txt tT Se TA T a STIER NC ve S and N KT NET S Cu SEULE cha RE SS nis FEAR nr w 1 mS 5 a ier j mA X EL Adi sas Lab 9 will help you start building your vi skills V Sr Ira za e SHAN dec hr ah 4 iL SRE m aes ow ES us EAS LEN E E Une dom Df em nem mo mde Din votes wee e aded mop cmm OR Pawe OR 7a a FACIS pie 17 4 ec no Dorem fer my ane medo peus amer en mA De erem s adm us oom 09 m E ym e vaste have 4 Gen c9 me a are wre vini Fore merus olet chee 4 Instructor remember to mail students the tech file Pron cR lm m om eS om Pm cmm mmm Deus ded cem c m Yun Nenn on on n eyes fre ot ee M pan ie Be cis90 lab09 mail tech all Die Am eee oe m yH coo p u ve 9 Uem ee mdi mmm oom corem
37. rep f usr lib cups backendjd serial Permission denied t usr lib cops backend ipp Permission denied i usr lib cups backeng http Permission denies usr lib cups backend dnasd Parmiasion denied usr lib cops backend lpd Permission denied usr lib cups backend mdns Permission denied lorep usr lib sups backend 5rtps Permission denied fnome ciaSi simben PID PPID C PRI NI ADOR SE TIME CMD D M home cis90 qguent 3 v 3 42893 6270 0 880 D 1308 e 00 00 00 bash 3 i 0041 0920 0 80 0 2099 00100100 sand 8s9 42 3131041 So 0 1208 90 00 00 bash 5032 942 23 80 D 136 00100103 grep N nomn c1200 quent CIS 90 Lesson 11 PLATE COMMERCIAL CODE SIGN ALS EXAMPLES OF THE SEVERAL HOISTS WHICH OAN BE MADE HAVING TWO THREE OR FOUR FLAGS When a word contains two letters of the same name the second time of fts oocarremos it begin or be in the 2nd Holst And on La donnera 1t must begin or bein the A Hai URGENT amp IMPORTANT SONALS COMPASS SIGNALS Coos Fia Over Fiac OR Fe Amabourfosail bondon te Vessel TUDE SIGNALS Ciria Samen IE La tude North Leriruce NUMERAL TABLE GENERAL JOASA CROCKER Sera CODE FLAG UNDER 2 FLAGS ELLING SIGNAL O Right turn Slow or stop Left turn z A 3 om FLAG SIGNALS a de of Glasgow 133 ons Me 32896 JAMES BROWN amp SON GLASGOW 73
38. ry searched find command in the 4th directory searched usr bin bin directory 5th directory searched usr local sbin 6th directory searched usr sbin 7 directory searched sbin 8th directory searched home cis90 simben bin 9th directory searched home cis90 simben bin 10th directory searched 60 CIS 90 Lesson 11 Ern 11 9H AF C4 2 i T System Commands Applications Kernel Execute Step 1 Prompt 2 Parse 3 Search 4 Execute 5 Nap 6 Repeat 61 CIS 90 Lesson 11 x LE p 33 Execute Step PID 1570 PID 1570 PPID 1476 PID 1476 PID 1476 Z UU PID 1476 PPID 1475 PPID 1475 PPID 1475 bash executes the find command by 1 Cloning itself with a fork system call to create a new child process 2 With an exec system call the new child process is overlaid with the find code instructions 3 bash sleeps by making a wait system call while the find child process runs 4 The child process makes an exit system call when it has finished 5 After that the parent bash process wakes up and the child process is killed 62 CIS 90 Lesson 11 4 ii Execute Step home cis90 simben find name treat 2 dev null stdout home cis90 primic treati home cis90 juetay treat1 home cis90 porjos treat1 home cis90 beycha bag treat1 home cis90 drydan bag treat1 home cis90 rodduk treat1 home cis90 tosbre treat1 home cis9
39. shell prompt The prompt step is not complete until the user presses the Enter Return key 54 CIS 90 Lesson 11 ER 11 pw 23 Parse Step IAL NAVF 7 2 o 1 Prompt 2 Parse 3 Search 4 Execute 5 Nap 6 Repeat 56 CIS 90 Lesson 11 E 11 ru Parse Step The shellues I spaces to separate find name treat 2 dev null options arguments and redirection The shell must expand filename expansion Parsing RESULTS characters and variables during the parse step Command find This will be passed to the command Na VN MEQUE if the command can be located on the path name treati This will be handled Redirection by the shell The Connect stderr to dev null the bit bucket command if loaded will not see this Note Because Benji had a treat1 file in his home directory the shell 57 expands treat to treati CIS 90 Lesson 11 Ern 11 9H AF C4 2 i T System Commands Applications Kernel Search Step 1 Prompt 2 Parse 3 Search 4 Execute 5 Nap 6 Repeat 59 CIS 90 Lesson 11 Search Step uses PATH variable Command find The shell now must search in order every directory on Benji s path to locate the first occurrence of the find command Benji s path is defined by the value of his PATH variable ist directory searched usr lib qt 3 3 bin 2nd directory searched usr local bin The shell locates the 3rd directo
40. teach com And thanks to John Govsky for many teaching best practices e g the First Minute quizzes the online forum and the point grading system http teacherjohn com CIS 90 Lesson 11 X 4 l pu Q Browse to the CIS 90 website Calendar page 1 http simms teach com 2 Click CIS 90 link on left panel 3 Click Calendar link near top of content area 4 Locate today s lesson on the Calendar Q Download the presentation slides for today s lesson for easier viewing Q Click Enter virtual classroom to join CCC Confer session Q Connect to Opus using Putty or ssh command CIS 90 Lesson 11 Kk i pu Student checklist for laying out screen when attending class Q Google Q CCC Confer Q Downloaded PDF of Lesson Slides 2 B Rich s Cabrillo fand CCC Confer MEH SIMMS VIRTUAL CLASSROOM File Edit View Tools Window Help n SE a fide 2 Eri xw Rams u EEDISI SSS ST UE Sry bi 7252777 e a lass Activity Where are vou now as P c ity Bid bete E you now E a p _ k Ed d rl 1444 s 44 sB ZLDINIF M Bert Sams 248pPM Where 5 good place to get a used version of the Roch Sirrens 248 PM M Amazon has some good prices nght now cis90lesso pdf L One or more login Q CIS 90 website Calendar page sessions to Opus 5 Start Sharing
41. to write to TTY POSIX Urgent condition on socket 4 2 BSD CPU limit exceeded 4 2 BSD File size limit exceeded 4 2 BSD Virtual alarm clock 4 2 BSD Profiling alarm clock 4 2 BSD Window size change 4 3 BSD Sun I O now possible 4 2 BSD Power failure restart System V Signal 18 continues a stopped process isn t that what bg does 153 CIS 90 Lesson 11 RL D 11 ru The bg command is used to resume a stopped process home cis90 roddyduk sleep 60 Ctrl F or Ctrl Z typed here 1 Stopped sleep 60 home cis90 roddyduk bg l sleep 60 amp home cis90 roddyduk Jobs Lie BRunn ng sleep 60 amp home cis90 roddyduk Jobs Lie BRunn ng sleep 60 amp home cis90 roddyduk jobs 1 Done sleep 60 home cis90 roddyduk bg resumed the stopped process which runs till it is finished 154 est 1959 S CIS 90 Lesson 11 7 p E Instead of using bg to resume a stopped process in the background lets try a SIGCONT signal 18 instead home cis90 roddyduk Ctrl F or Ctrl Z typed here 1 Stopped home cis90 roddyduk B uS UID PLD FPID 0 5 1000 10705 10704 OlT 1000 10743 10705 O R 1000 10744 10705 home cis90 roddyduk 1 Stopped home cis90 roddyduk home cis90 roddyduk LI Running home cis90 roddyduk e UID PLD PPID 0 S 1000 10705 10704 O S 1000 10743 10705 O R 1000 10746 10705 home cis90 roddyduk l Running home cis90 roddy
42. uit N erase kill U eof D eol swtch lt undef gt start 0 stop S lnext V flush O min 1 time 0 lt undef gt eol2 lt undef gt rprnt R werase W Why does the keystroke to send a Suspend SIGTSTP or 20 signal differ between roddyduk F or Ctrl F and rsimms Z or Ctrl Z 147 CIS 90 Lesson 11 AIRE Job Control A feature of the bash shell KU Ctrl Z or Ctrl F sends SIGTSTP 20 signal e Stops suspends a foreground process rsimms opus sleep 5 Ctrl Z is tapped which stops the sleep command 1 Stopped rsimms opus 9 ps l u rsimms B 2 UID PID PPID NI ADDR SZ TTY TIME 5 S 201 5368 5365 0 2460 00 00 00 PID 7728 0S 201 5369 5368 0 1165 pts 0 00 00 00 is stopped 5 S 201 6203 6200 0 2491 00 00 00 0S 201 6204 6203 0 1165 pts 6 00 00 00 R rsimms opus pts 148 CIS 90 Lesson 11 Job Control feature of the bash shell bg command e Resumes a suspended job in the background est 1959 S rsimms opus sleep 5 1 Stopped rsimms opus bg 1 sleep 5 amp rsimms opus bg resumes the sleep command rsimms opus ps l1 u rsimms UID PID PPID PRI NI ADDR SZ PID 7728 is gone F 5 O 5 O O S S S AOL S ZOL S 204 S 204 R 20 rsimms opus 5306 3369 6208 6204 7742 9902 5368 6200 6203 9909 C O O O O O T9 76 T9 TO 18
43. us LL n What is your name NAME n What is your favorite bone BONE Hi SNAME your favorite bone is SBONE mn mn mn mn mn mn Mt mn mn Mt Mt Keep your hands OFF THE MOUSE don t use it in vi 110 CIS 90 Lesson 11 est 1959 S lype a EP simben90 opus n What is your name NAME n What is your favorite bone BONE Hi SNAME your favorite bone is SBONE lx mt mn mn mn mr mr Keep your hands OFF THE MOUSE don t use it in vi 111 CIS 90 Lesson 11 est 1959 S Type wq EP simben90 opus n What is your name NAME n What is your favorite bone BONE Hi SNAME your favorite bone is SBONE mn mn mn Mt nt nt nt nt mn Keep your hands OFF THE MOUSE dont use it in vi 112 CIS 90 Lesson 11 Tap the enter key home cis90 simben vi dogbone home cis90 simben 113 est 1959 gt Mi M E Mi M Mi 3 Add execute permissions and try your new script home cis90 simben S chmod x dogbone nome cis90 simben dogbone What is your name Benji What is your favorite bone chicken to Hi Benji your favorite bone is chicken Sih home cis90 simben jia 114 CIS 90 Lesson 11 VI COMMAND mode INSERT mode command LINE mode 115 CIS 90 Lesson 11 home cis90 simben cp letter myletter
44. us If so type the version of mysql server in the chat window 37 CIS 90 Lesson 11 ES 1 a i b Le 7 grep usage search output of a command When were the last 5 times I logged in home cis90 simben last grep LOGNAME head n5 simben90 pts 0 simben90 pts 6 simben90 pts 5 simben90 pts 4 simben90 pts 1 oU TUO Zeek LO OO 2922 100 297 LU 0202 Sure Zo mor NM Mon Wed Wed Wed Wed Apr Apr Apr Apr Apr eo 18 18 18 18 05 09 12 La 12 DOS 48 48 48 06 still logged in 16 51 04 02 16 51 02202 Pool 04 03 10523 02 17 This scans the latest wtmp log file and lists your most recent five logins to Opus 38 CIS 90 Lesson 11 La R in grep practice For the time period covered by the current wtmp log file What was the date of your earliest login Type your earliest login date into the chat window rsimms oslab ksh S dash s sh bin csh sh 4 15 esh S E 6 O O O 6 O AJ UNU UY CG Oy 2 UID 201 201 201 201 201 201 PID 26146 25997 290945 26346 26348 2602 PPID 26145 26146 260 20343 26346 26348 rsimms oslab ps l G O CO CIS 90 Lesson 11 binydash bin ksh 7bi n rbash i J bin Sh pu grep usage search output of a command rsimms oslab ls bin sh Jeary bash bin tesh Look familiar lab 8 Shows how to compare shells b
45. ut in the forest where I might get caren a bear Take me bore I promise that I won t make noise OF meer the house wich other boys ch plesse don t mate me tay I ve been here one whole day Desrest Father darling Mother box s my precious Little Seother I will come home if yoo miss se I will even lez Aunt Sertha hug and kiss me rt Camp Granada Things are very entertaining n they say we l1l have some fun when it stope raining All the counselors hate the waiters and the lake has 1ligetors You remember Leonard frinper Me gor tonaina poisoning last night after dinner Now I don t want this to scsre you but my bunk mate bas laria You rwzamber Jeffrey Hardy Theis about tc lorganize a searching party Tete me bass ch Mother Father tate me Komm I hate Granada Don t leave me out in the forest where I might get eaten y a bear Take me home I promise that I won t make noise the Scouse with other boys ch please dzn t mate me I ve been here one whole day Father darling Mothers Sox s my precious little brcther I will come home if yoo miss se I will even Lez Aunt Bertha hug and kiss me CIS 90 Lesson 11 E ru VI Moving around in a file Use in COMMAND mode h moves the cursor one character to the left Try typing j moves the cursor down one line number in front of k moves the cursor up one line these commands and notice what I moves the cursor one character to the right happens Ad scro
46. xe Virtual classroom locked docx CCC Confer Juan COC Confer RICH SIMMS VIRTUAL C S cky Note PS Microsoft PowerPoint powerpnt exe cigQ0lesson1 ppt Mici J C Program Files lt 86 putty exe ambersoGodel 4 Select Share desktop and click Share button CIS 90 Lesson 11 Preload White Board i Custom J e Connect session to Teleconference MAIN ROOM 2 ns Le Session now connected imm to teleconference Moderator You X M Teleconference i 2 Is recording on Red dot means an Use teleconferencing not mic Should be greyed out AUDIO amp VIDEO C CCC Coste CH EB Fie Edit View Took Windes Help k Fm onm beste Sony Vireo Mikrcpehzne meingi ont Settings Narre Seveterves co T ades kapit MAU cadre Lowe Lp apuit Macrogtore Lec Down apart Semmes teet Lip art Spear Level Down Mabe Views falma Mecerator Fena Weber Vid o Fito Spesie Detach une 3 Should show as this live off hook telephone handset icon and the Teleconferencing message displayed CIS 90 Lesson 11 PA cis90lesson07 pdf Foxit Reader Ze aa ja rem pdf VE uu 7 m V3 Cor ne 8 owe B File Edit View Tools Comments Forms SharePoint s cis90 cis 90 TEST 1 Fa Ee C I simms teach com docs c sages oi m cf Part 1 Flashc E 1 point each C
47. xecute 5 Nap 6 Repeat 69 PPID 1475 CIS 90 Lesson 11 X E TF p Repeat Step PID 1570 PID 1570 PPID 1476 PID 1476 PPID 1475 The child process makes an exit system call when it has finished The parent bash process wakes up the child process is killed and we are ready to start the process all over again with the next command 70 u f zd T a Hr 1 Ca CoMege CIS 90 or Seen Process activity e See if you can do a ps command that illustrates what happens when a user runs a long grep command e The ps output should show parent bash S Sleeping while the child grep command is either R Running or in D Uninterruptible sleep IO e Start a second login session to observe your processes Write your grep PID and status into the chat window when done home cis90 simben S grep r past usr llozep est lib audit Permission denied home HET S Q 0 guest S ES lu simben90 l asar lib perls5 Maet DNH3 Raesclver Racurse pm 9 Purpose Do that hot pstots dance 3 1001 6841 8820 0 8 0 2899 00 00 00 sand 10 9 1001 939047 41 O 80 D 43308 00 00 00 bash 110 D 1001 8032 8842 21 89 D 1349 00100102 grep nome c1290 quest 8 pe lu simbenso UID PID PPID C PAT MI ADOR Jz TIME CHD 6283 4270 O 690 0 1308 00100100 bash 3 1001 884 88620 0 t 0 3009 X 00 00 00 sand 1001 8642 8843 9 00 D 1308 00100100 bash 1001 9022 mau 23 890 0 10269 00 00 02 g
48. y PID Try kill 1 PID Try killall 1 annoy Try kill 2 PID OR Try killall 2 annoy Try kill 3 PID Try killall 3 annoy e and so forth e and so forth Write the signals that kill annoy into the chat window 80 1 LUN X k 4 I g Using amp to run a command in the background est 1959 S CIS 90 Lesson 11 Job Control Using amp to run a command in the background 5 Applications Places System gt _ 772 File Edit View Terminal Help cis90 eko firefox Wed Nov 10 8 03AM Ty cis90 5 4 Ubuntu Start Page Mozilla Firefox File Edit View History Bookmarks Tools Help After running g Firefox in the foreground it s not possible to enter more commands until Firefox is closed Ubuntu Start Page Google AA G http star ubuntu com 10 04 v v fj Most Visited v 6 Getting Started Latest Headlines v or v Done ww C cis90 eko Ubuntu Start Page Mo Search Update Manager 82 CIS 90 Lesson 11 Job Control Using amp to run a command in the background 43 Applications Places System 79 Wed Nov 10 8 04 AM fy cis90 4 p RE _ File Edit View Terminal Help cis90 eko firefox cis90 eko Ifirefox amp 1 1465 cis90 eko ps Ubuntu Start Page Mozilla Firefox PID TTY TIME CMD File Edit View History Bookmarks Tools Help 1370 pts 0
49. y size and record the biggest one in a file PRL 80 80 80 O0 80 80 NI D CX Co C5 size ADDR ls WCHAN 1429 524 1314 1822 1220 rsimms oslab ps 1 grep bash 201 26146 26145 Jg O rsimms oslab ps 1 80 O grep rsimms oslab cat bigshell 201 26146 26145 0 3 O 80 0 1700 bash TTY pts 3 pts 23 pts 3 pts 3 pts 3 pts 3 pres bigshell 1700 pts 3 00 00 DOS 00 00 Dos 00 00 TIME 00 00 00s 00 00s 00 00 00 OO OO 00 OO OO OO OO OO CMD ksh dash sh csh DS bash bash 40 CIS 90 Lesson 11 Sm R i p grep practice Instructor note add write permission to others on Benji s terminal device Run bash dash ksh sh and csh shells and use ps I to see which is the smallest Redirect the line of ps I output for the smallest shell to Benji Simms s terminal dev pts Sign it with echo From first name gt dev pts Then exit each shell till your are back to just one bash shell running 4 CIS 90 Lesson 11 E 11 ru grep usage search inside files How many CIS 90 user accounts are there home cis90 simben grep 190 etc passwd wc 1 29 home cis90 simben grep cis90 etc passwd wc 1 23 home cis90 simben grep 2 6 90 etc passwd wc 1 35 only There are 35 The third example is a regular expression For mor
Download Pdf Manuals
Related Search
Related Contents
Energy Sistem Slim 3 8GB CDF3000 - Deiring BlueWalker PowerWalker VI 1200 TP-LINK 24-Port Gigabit Desktop/Rackmount Switch Visual Project Configuration - Visual Project INSTRUCTIONS CHUIT P ALLANO M La suspicion : premier cas de syndrome The NEPTUNE SPACE full face masks FinePixViewer 3.3 G VARI-FOCAL DOME Copyright © All rights reserved.
Failed to retrieve file