Homework 2 – File System


Given out Wednesday, September 4, 2019

Due Sunday September 15 at 1159pm via BLACKBOARD

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

To complement this homework, you should login a UNIX host and create a directory containing the following items.

(1)  Create a file called “realityFile” containing a few lines of text. 

(2)  Create a normal (hard) link to “realityFile” and call it “hardRealityFile”.

(3)  Create a soft (symbolic) link to realityFile and call it “softRealityFile”.

(4) Create a copy of file “realityFile” and call it “copyRealityFile”.

Q1: (20 points) Explain what commands you used to set all this up.

Q2: (10 points) Give the output of ls –l on each file? Make some changes to the text in “realityFile”. And then give the output of ls –l on each file? Explain how they are different.

Q3: (10 points) What is the inode number of each file? (You can get the inode number with ls –i)

Q4: (10 points) Use the file command and record what type of file each is. Explain any differences.

Q5: (10 points) Make “hardRealityFile” readable, writeable, executable by you, but not readable, writeable, executable by anyone else. What command you used to do this.

Q6: (10 points) What is the permission of “realityFile” before and after you do Q5? How they are different? Why?

Q7: (10 points) cat each file. Are the results the same for each file?

Q8: (10 points) Make some changes to the text in "softRealityFile". Explain what happened to the file size of "hardRealityFile", "realityFile", and "softRealityFile".

Q9: (10 points) Move "realityFile" to "realityFile1". What is the output of ls -l. Explain what happened to "softRealityFile", copyRealityFile, and "hardRealityFile" (consider link count and inode number).