24 Feb
2006
24 Feb
'06
13:27
Shriramana Sharma wrote:
I know the difference between a hard link and a soft link. Basically a hard link is another file name to the same physical file on disk. A soft link is a special file containing the path to a regular file.
If I use ls -l, I am able to see the l at the beginning of the permissions for soft links. But for hard links I do not see any such special mark except that they share the same inode if I use ls -i.
Every item in a directory is a hard link, unless it's a soft link. That is when you create a file, you are in fact creating a hard link to it that appears with ls. When you delete all hard links to a file, that file is then "deleted".