Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected...
-
Upload
albert-farmer -
Category
Documents
-
view
222 -
download
0
Transcript of Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected...
![Page 1: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/1.jpg)
![Page 2: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/2.jpg)
Agenda•Link of the week•Use of Virtual Machine•Review week one lab assignment•This week’s expected outcomes•Review next lab assignments •Break Out Problems•Upcoming Deadlines•Questions and answers
![Page 3: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/3.jpg)
Link of the week• http://dmoz.org/Computers/Software/Oper
ating_Systems• Definition of Operating System (OS)• Basic tasks performed by an operating
system– Control and allocate memory– Prioritize system requests– Control input and output devices– Facilitate networking and management file
systems
![Page 4: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/4.jpg)
Link of the week• Services an Operating System (OS)
performs– Process management
Demonstrate test_file.txt on cs.franklin.edu– Memory management
OS coordinates various types of memory – File systems– Networking – Graphical user interface (GUI) and command line– Device drivers– Security
• Internal management• External management
![Page 5: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/5.jpg)
Use of the Virtual Machine• Received two CD’s from Franklin University. Use
the ITEC 400 Virtual Machine CD to install your Knoppix 5.1.1 software.
• Why is Knoppix OS being utilized in this course?• Knoppix features• Review VMware Desktop using Franklin Live• Demonstrate how to ftp a file from your
computer to Einstein using VMware software
![Page 6: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/6.jpg)
Review week one lab assignment
if [ ]then
…fi
while [ ]do …done
for file_name in *do …
done
$1, $2, $3
cd $1
![Page 7: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/7.jpg)
Review week one lab assignmentif [ $# -ne 1 ]then …
…
elif [ $1 -gt 0 ]then
while [ $variable -gt 0 ] do echo -n $variable if [ $variable -gt 1 ] then … fi VARIABLE=$(( $VARIABLE - 1)) done echoelse … …fi
![Page 8: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/8.jpg)
Review week one lab assignmentman (use “q” to terminate view)
ls –l
ps
cut –f 9
cut –c 1-7
wc -l
$#
date
exit 0
exit 1
NUMBER=$2
echo $NUMBER
less
![Page 9: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/9.jpg)
Weeks 2 and 3 expected outcomesUpon successful completion of this module,
the student will be able to:
• Create scripts using shell variables and program control flow.
• Use man page system and find script tools.
• Use redirection and pipes to combine scripts and executables.
![Page 10: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/10.jpg)
Review next lab assignmentConcentric Circle Relationship
KERNELHARDWARE
Shell
Utilities
Kernel
csh
sort
ps
vi
![Page 11: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/11.jpg)
Review next lab assignment
• Use the editor of your choice to open and save a file.
vi test_file.txt
o (insert text - alpha character)
Esc key (exit insert mode)
:wq! (save text entered in file)
:q! (quit without saving changes)• echo $NUMBER• myArray[1]=$1
![Page 12: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/12.jpg)
Review next lab assignmentUsers can connect the standard output of one
command into the standard input of another command by using the pipeline operator (|).
• ps –ef | wc –l• ps –ef | awk ‘{print $1}’• who (users who are logged on)• who –b (time of last system boot)• who –d (print dead processes)• who –r (print current run level)• Each command has a return value.
0 indicates a normal exit1 indicates a failed exit
The return value of a command can be used with conditional or iteration commands.
![Page 13: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/13.jpg)
Review next lab assignment• A process associates a number with each file that it has opened. This
number is called a file descriptor. When you log in, your first process has the following three open files connected to your terminal.
Standard input: File descriptor 0 is open for reading.Standard output: File descriptor 1 is open for writing.Standard error: File descriptor 2 is open reading.
• Linux command documentation is known as man. Each page is a self-contained document. The Manual sections are split into eight numbered sections:
1 General commands.2 System calls3 C library functions4 Special files (usually devices, those found in /dev) and
drivers.5 File formats and conventions6 Games and screensavers7 Miscellaneous8 System administration commands and daemons
![Page 14: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/14.jpg)
Review next lab assignment• The grep command searches the named
input file(s) for lines containing a match tothe given pattern. Normally, each line foundis reported to standard output.
Demonstrate: grep lines ~dandrear/summer08_solutions/foobar_1
• The find command lists all pathnames thatare in each of the given directories.
Demonstrate: find / -type d –printThe above command displays all directorynames starting with root in the file system.Demonstrate: find ~dandrear –type d -print
![Page 15: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/15.jpg)
Review next lab assignmentRedirect the standard output of a command
to a file.
• date > /tmp/date_saved
Redirect the standard input of a command so that it reads from a file instead of from your terminal.
• mail dandrear < ~dandrear/summer08_solutions/report.txt
Append the standard output of a command to a file.
• cat foobar_2 >> foobar_1
![Page 16: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/16.jpg)
Review next lab assignmentDemonstrate: srch
• Code one small script function at a time.
• Test that function before adding more code to the script.
• Program coding is an iterative process (code,test,code,test,code,test, …).
![Page 17: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/17.jpg)
Break Out Problems• ps | wc –l• who | awk ‘{print $1}‘ | sort –u | wc –l• ps –ef | awk ‘{print $1}’ | sort –u | wc –l• sort –r names.txt• ps –ef | awk ‘{print $9, $1}’ • find /bin -name gzip• find /etc -name motd• > newfile• rm newfile• date | cut –c12-19• nohup grep This ~dandrear/summer08_solutions/report.txt &• cp test_data.txt ~dandrea/temp• mv test_data.txt ~dandrear/temp• printf $NUMBER• Script: ~dandrear/summer08_solutions/person.sh
#!/bin/ksh person=`who | grep $1` echo $person
![Page 18: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/18.jpg)
Upcoming Deadlines
• Simple Shell scripts, Lab Assignment 2-1 due 5/18/08.
• Provide your proctor information by 5/17/08.• Verify that your login is correct on Einstein.• Configure your directory structure on Einstein to
comply with course specifications.• Advanced Scripting, Lab Assignment 4-1 due
5/25/08.
![Page 19: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/19.jpg)
Questions and answers
• Questions
• Comments
• Concerns
• After class I will help students with their scripts.
![Page 20: Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.](https://reader031.fdocuments.net/reader031/viewer/2022013101/56649ef25503460f94c03e04/html5/thumbnails/20.jpg)