File access and manipulation - Part A : Directories
30 points

Due In class, at start of class, 6 July 2006

See instructions under the table.

 Permissions for user
Commandsrw- --- ----wx --- ---r-x --- ---
  • cd dir1
  • 11 12 13
    • cd $HOME/330
  • ls dir1
  • 212223
  • cat dir1/fs1
  • 313233
  • cp dir1/fs1 a
  • 414243
  • mv dir1/fs2 b
  • 515253
  • cp f1 dir1/fs1
  • 616263
  • cp f1 dir1/sa
  • 717273
  • mv f1 dir1/fs1
  • 818283
  • mv f2 dir1/sb
  • 919293
  • rm dir1/fs1
  • a1a2a3

  • rmdir dir1
  • b1b2b3
  • rm -r dir3
  • c1c2c3
  • rmdir dir2
  • d1d2d3
  • rm -r dir4
  • e1e2e3

    Note: for all three parts of this assignment, you are to print out the web pages and fill in the information.

    1. Make 330 your current working directory.

    2. Create the following directory files - dir1, dir2, dir3 and dir4

    3. Create the files f1 and f2 in the 330 directory. Use the following command sequence.

    4. In both dir1 and dir3, make the files fs1 and fs2. Use touch

    5.a. In the table above there are a series of commands list down the left hand side and a series of permissions across the top. For this assignment, you are to set owner(user) permissions of the four directories dir1 dir2 dir3 and dir4 to those listed above the first permissions column and then attempt each command listed in the command column. Set group and other's permissions to none.

    5.b. In each box, record whether the command failed or suceeded. A failure will be signaled by an error message from the system. If the command fails, write failed in the box, also use the number in the box to indentify the command and permission combination that failed and write down the error message on a seperate sheet of paper. If the command suceeds, write success in the box.

    6. When you have finished the first column, change all directory permissions to 700. Run the commands

    Delete files a and b from the 330 directory. You must now recreate the directories and files described in steps 2 through 4.

    7. Now set owner permissions of all four directories to permissions listed above second permissions column and repeat commands listed down the left hand side, recording results and failure messages.

    8. Repeat step 6. and set owner permissions of all directores to permissions listed above the last permissions column. Repeat commands and record results.

    9. When done, look at the failures in each of the permission columns and give a general explanation on how and why a particular permission influences the various file commands. Analyze the behaviour of the last 4 commands ( the rm -r and rmdir commands ) seperately from the others.