Thursday, June 12, 2008

Managing Hard and Symbolic Links in Solaris/Unix:

This article explains the purpose and usage of hard and symbolic links. A link is a file that points to another file. There are two kinds of link available

1.Hard Link:

a. A Hard Link is a pointer to a file that is indistinguishable from the original file.

b. Any changes made to a file are effective regardless of the name used to refer to the file – the link file or the original file name.

c. The link and the file are on the same file system because both have the same inode number.

d. A hard link can only point to a file, not to a directory.

e. You cannot create a hard link file without having the existing file.

f. The hard link file will consume the same amount of the disk as that of the original file.

g. If you delete the link file, the other will exist and the reverse is also applicable.

Syntax of the Hard Link file:

To create a hard link file,
#ln {source} {Target}

To remove the same file,
#rm {linkfile}

2.Symbolic Link:

a. A Symbolic Link is an indirect pointer to a file and it can span the file systems.

b. A symbolic link can be pointed to either file or directory.

c. You can create a symbolic link without having the existing file.

d. The symbolic link file will have the different inode number.

e. The symbolic link file will just have the details of the pointer information of the original file alone. Hence it won’t consume the same space as that of the original file.

f. It is just like a shortcut in the Windows.

g. If you delete the shortcut link file, the original file will exist. The reverse is obviously not applicable. It is better to clean up the shortcut files i.e, symbolic file before deleting the source file.

Syntax of the Symbolic Link file:

#ln –s {Source} {Target}


91-98414 99143

1 comment:

Anonymous said... is very informative. The article is very professionally written. I enjoy reading every day.
payday loans edmonton
cash advance