What would happen if you ran:

You have read/write permission on an ordinary file foo. You have just run:
ln foo bar
What would happen if you ran:
rm foo

You have read/write permission on an ordinary file foo. You have just run:
ln foo bar
What would happen if you ran:
rm foo

A.
foo would be removed while bar would remain accessible

B.
foo and bar would both be removed

C.
You would be asked whether bar should be removed

D.
Both foo and bar would remain accessible

E.
foo would be removed, bar would still exist but would be unusable

Explanation:
The In command is used to create the link. There are two types of link a. Soft link b. Hard link.
a. Soft link Can create for directory also, can span multiple pratations but available until and unless Original Files remain.
Syntax for Soft link In-soriginalfile linkfile
b. Hardlink Can separate Physical File, can’t create for directory, can’t span multiple file but remains the link file if original file removed.
Syntax for Hardlink In originalfile linkfile In Questions, created the bar hardlink of foo. That means bar is on separate physical file.
The file bar is accessible after removing the foo file also.



Leave a Reply 0

Your email address will not be published. Required fields are marked *