Given out Monday September 10, 2012
Due Sunday September 16 at 6pm via ANGEL
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.(Use the ln command to create hard and soft links.)
(1) Create a file called “realfile” containing a few lines of text.
(2) Create a hard link to “realfile” and call it “hardlink”.
(3) Create a soft (symbolic) link to realfile and call it “softlink”.
(4) Create a copy of file “realfile” and call it “filecopy”.
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 “realfile”. 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 “hardlink” 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 “realfile” 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 "softlink". Explain what happened to the file size of "hardlink", "realfile", and "softlink".
Q9: (10 points) Move "realfile" to "realfile1". What is the output of ls -1. Explain what happened to "softlink" and "hardlink" (consider link count and inode number).