Homework 2 – File System

Given: Monday, September 12, 2011

Due in class on:  Monday, September 19, 2011, at 6pm by ANGEL

You will need access to a Unix (or Unix-like) system for this assignment. There is no requirement to use a particular system, or kind of system.

You will need to submit your name, student ID, and the answers to the following questions.

Use man pages to get the syntax for any commands below that you are unfamiliar with.

 

In order to answer the questions below, first do the following (in order):

 

l  Create a file called "realfile" containing a few lines of text.

l  Create a hard link (using ln) to realfile and call it "hardlink".

l  Create a soft (symbolic) link (using ln) to realfile and call it "softlink".

l  Create a copy (using cp) of "realfile" and call it "filecopy".

 

Questions:

Q1: Briefly summarize the organization of the UNIX file system. Make sure you describe the concept of inodes. (5-10 sentences is about right here.)

Q2: Explain what commands you used to set all of the above files up.

Q3: What is the output of ls –l on each file? Make some changes to the text in “realfile”. And then, what is the output of ls –l on each file? How they are different?

Q4: What is the inode number of each file? (You can get the inode number with ls -i)

Q5: Use the file command and record what type of file each file is. Explain any differences.

Q6: Make “hardlink” readable, writeable, executable by you, but not readable, writeable, executable by anyone else. What command did you use to do this?

Q7: What is the permission of “realfile” before and after you do Q6? How they are different? Why?

Q8: cat each file. Are the results the same for each file?

Q9: Make some changes to the text in "softlink". Explain what happened to the file size of "hardlink", "realfile", and "softlink".

Q10: Move "realfile" to "realfile1". What is the output of ls -1. Explain what happened to "softlink" and "hardlink" (consider link count and inode number).