Lab #1 CIS213 Ð Unix Introduction

Getting Started

This lab is to provide a tutorial for the unix operating system. The tutorial is provided online.

 

1. To get started you will need to open your web browser:

 

% netscape &

 

2. Open the webpage at the following URL:

 

http://www.ee.surrey.ac.uk/Teaching/Unix/

 

3. Read the first 2 sections, Typographical Conventions and Introduction to The UNIX operating system

 

4. Now complete Tutorials 1-8 and answer questions in the deliverables section.

Issues

There were a few issues in the tutorial that made it less interesting on our systerms or a situation where the command did not exist. Therefore, this list should be consulted as you do the tutorials; they are ordered by section number.

  1. In Part 2.1, there is a file that is being copied called science.txt. Since you are not at that university, you have to download the file to your unixstuff directory instead of copying it. In the paragraph below the cp command there is a link ÒhereÓ. Click that, and then use File->Save As on your browser to save to your unixstuff directory. Now you can do the exercise.
  2. In Part 2.4, after using less, replace less with the more command. You may use more as a replacement for less at any time (for the most part).
  3. In Part 3.4, most likely the who command will only show you logged on and so it is not that interesting. Instead of using who, use the last command (last shows who were the last people to log in and when). This will show a more diverse list where the sorting is useful.
  4. In exercise 3b, there is a suggestion about using the printer. You may do this, but our printers are named lp1 and lp2 (located in the lab). Replace the printer name hockney with lp1 or lp2.
  5. In Part 8.5, there is the use of nedit (a basic editor). You may replace this with the editor you typically use: xemacs, xcoral, vi, pico, etc.

Lab Sessions

This lab is to be done outside of class.

Deliverables

Answer the following questions as you do the tutorials:

 

1. In exercise 1a, show the command you used.

 

2. What does the following command do?

% ls ~

 

3. In exercise 2a, show the command you used.

 

4. What is the command to view the last 15 lines of the science.txt file?

 

5. What is the command to view the first 15 lines of the science.txt file?

 

6. How many lines does the science.txt file have? How many words?

 

7. What did ls ?list output?

 

8. In Exercise 5a, what permissions did you decide to change? What command

did you use to make that change? (show the before and after results using ls -l)

 

9. Is it possible to use the kill command to kill other user's processes? Why or

 why not? (hint: look at 5.1 ideas)

 

10. Using compress and ls -l, show the before and after in the file size of scie

nce.txt.

 

11. What does the following do?

% ls -l; cat slist

 

Submission

Create your cis213 directory

% cd

% mkdir cis213

% cd cis213

% mkdir lab1

% cd lab1d

Use your editor to open a file called lab1.ans, and type your answers there, and then use the turnin program to submit:

 

% turnin cis213 lab1

 

NOTE: view the output of the turnin to verify that all of the necessary files have been submitted.