Name:

Date:                             

 

 

Lab 1 – The Unix File System

Introduction

Due

Lab Steps 

Step 0 – Unix beginners only

1.     If you are a Unix beginner, start with the Unix Tutorial for Beginners. Get familiar with the Topographical Conventions and read the Introduction section, paying particular attention to absolute and relative paths. Then work through the steps in Tutorial One and Tutorial Two. 

Step 1 – Creating a Unix file structure

  1. Log in to your CS department Unix account following these instructions. For new student Unix accounts the password is FA followed by your 8 digit VUID.
  2. Create the following Unix structure in your home directory

To create a directory, use the mkdir command. To create a file, use the editor pico. For example, to create the file concat.c in the directory strings (assuming that you have already created the directory structure), type in

pico ~/csc8400/strings/concat.c

The contents of the file are not important for this exercise, so simply type in any string you want (for example, “This is the file concat.c”), then save it with Ctrl-O (see the menu at the bottom of the editor window) and hit Enter, then Ctrl-X to exit. To make sure that the file has been created, display the contents of the strings directory

ls ~/csc8400/strings/

You should see the name of the file listed. To display the file contents, use

more ~/csc8400/strings/concat.c

Alternately, you may use the more powerful editor emacs or any other editor you are familiar with.

  1. Use the ls command multiple times to verify that you have created the correct structure.
  2. Report success or failure to the instructor and have the instructor or TA initial here: _______
  3. ALTERNATIVE TO INITIALS: If you work through this tutorial on your own, briefly describe here in writing what you did and what you learned:

Step 2 – Modifying the Unix file structure

1.     Make a copy of the entire file structure you created in step 1, so you can revert to it in case you accidentally delete something:

cp -r ~/csc8400 ~/csc8400copy

In the following refer to the original copy your file structure (the one depicted above).

2.     What is the path to projects relative to your home directory? 

3.     What is the path to pointers relative to your home directory? 

4.     Make a copy of the pointers directory under the projects directory.

5.     Make a copy of the overflow directory under the csc8400 directory, then delete the original copy.

6.     Move the file tutorial.html in the memory directory.

7.     Copy the file stack.c in your home directory and rename it hello.c.

8.     Remove the strings directory (and its contents).

9.     Rename blocks.txt to blocks.mm

 

  1. The new directory structure should be as shown above. Use multiple ls commands to verify it.
  2. Report success or failure to the instructor and have the instructor or TA initial here: _______
  3. ALTERNATIVE TO INITIALS: If you work through this tutorial on your own, briefly describe here in writing what you did and what you learned: