C# PROGRAMMING
Part 1: Hard Link
1. Create a new directory named lesson10 and move to lesson10.
Create a new file named hardlink_test.txt and write "Hello Hard Link!" to this file.
Create another new file named softlink_test.txt and write "Hello Soft Link!" to this file.
Create a new hard link named hardLink in the /tmp directory to hardlink_test.txt.
Write a single line command here.
2. Display the content of /tmp/hardLink. It displays the original data.
Write a single line command here.
Type the following:
ls -il /tmp/hardLink
As you can see, the permissions, link count, ownership, timestamps, and file content are exactly the same. Use the ls -i command to view the inode (index node) number that identifies a specific file. Files that are hard-linked together share the same inode number, which is in the first column of the result of ls -il where the option i displays the inode number.
3. What are the inode numbers of hardLink?
Write your answer here
4. Delete the original file in lesson10.
Write a single line command here.
5. Display the content of /tmp/hardLink. Type:
cat /tmp/hardLink
What happens?
Write your answer here
6. Delete the hardLink in /tmp.
Write a single line command here.
Part 2: Soft Link
1. Create a new soft link named softLink in the /tmp directory to softlink_test.txt.
Write a single line command here.
2. Display the content of /tmp/softLink. It displays the original data.
Write a single line command here.
Type the following:
ls -il /tmp/softLink
Notice that /tmp/softLink is a symbolic link, pointing to the original file softlink_test.txt
3. If the original file is deleted, the soft link is broken. Delete the original file in lesson10.
Write a single line command here.
4. Display the content of /tmp/softLink.
cat /tmp/softLink
What happens?
Write your answer here.
5. Delete the softLink in /tmp.
Write your answer here.