Spring 2008 CSci 553 Lab 1

Lab 01: Part 1, In Class

Using the Unix Command Line


Instructions

Exercises 1.1 – 1.8 are to be completed in class before you leave. You need to create a directory in your home directory named “lab01” (you must use the exact same name, and remember that Unix is case sensitive, so “Lab01” is not the same name). Inside of the directory “lab01” you will create and edit a file called “lab01-part1.txt”. You should edit the file and type in your answers to the questions 1.1 – 1.8 before the end of class, and ask the instructor to confirm you are done with this part before leaving.


Use this lab time not only to find the answers to the questions, but to practice your skills in using the command line and editor to create directories, files and run commands. The first portion of the lab is to be completed in class so that you may ask the instructor for help and suggestions for any problems you may be experiencing learning the bash shell and command line commands. You may use any of the resources we have discussed to find the answers to the exercises, as well as the textbook and online source materials. It is of course suggested that you try out and test your answer where possible to verify it correctly answers the question.


Exercise 1.1



Exercise 1.2

Makefile biography.txt data enrolment.txt programs thesis


thesis programs enrolment.txt data biography.txt Makefile



Exercise 1.3



Exercise 1.4



Exercise 1.5


Name: Earth

Period: 365.26 days

Inclination: 0.00 degrees

Eccentricity: 0.02

Satellites: 1


$ diff earth.txt earth2.txt

3c3

< Inclination: 0.00

---

> Inclination: 0.00 degrees

4a5

> Satellites: 1



Exercise 1.6

-rwxr-xr-x 1 aturing cambridge 69 Jul 12 09:17 mars.txt

-rwxr-xr-x 1 ghopper usnavy 71 Jul 12 09:15 venus.txt



Exercise 1.7


Exercise 1.8


Lab 01: Part 2, Outside Assignment

Using the Unix Command Line


Instructions

Exercises 1.9 and higher are to be completed in your own time out side of class, but are to be finished no later than the beginning of next class period (Tuesday Jan XX). Use a new file to answer the questions for part 2, called “lab01-part2.txt”. This file should also be placed in your “lab01” directory.


These questions involve more of the advanced concepts, such as using pipes and I/O redirection, discussed in Lecture 04. To successfully complete some of these, you may need to combine 2 or more commands together using a pipe to obtain the requested results.


Exercises 1.G.* are more advanced questions, and only graduate (Csci 553) students are required to answer those questions.


Exercise 1.9


Exercise 1.10

Name: Earth

Period: 365.26 days

Inclination: 0.00

Eccentricity: 0.02


$ grep Period *.txt

earth.txt:Period: 365.26 days

venus.txt:Period: 224.70 days



Exercise 1.11


Exercise 1.12



-------------------------------------------------------------------------------------------------------------

Exercise 1.G.1


Exercise 1.G.2