Francais | Espanol | Deutsche | Italiano | 中文 | 한국어 | 日本語 |

This blog is owned by
Amey Palyekar
software engineer by profession


Add to Technorati Favorites
~My Links~



October 2006
April 2007


Computer Blogs -  Blog Catalog Blog Directory



Apr 20, 2007
Allows to create alternate fielname for you files, by associating multiple directory
entries with same inode.

One of the fields in inode called link count field is used to keep track of number of
entries that refer to same inode. Links can also be useful to provide an alternative
name in order to simplify typing of long path name.

There are two kind of links:
  • Hard links
  • Soft Links
-> Hard Links

With hard links all the different directory entries point to the same inode.
You can't create hard link to directory, so directory can never have more than
one name and each of filenames must be within same filesystem.

When link count for file equals zero, it means that there are no more directort
entries pointing to an inode. At this point inode data blocks are removed.
e.g: ln bellini /home/rule/compose/bellinih1
above command creates hard link to file 'bellini', in rule\compose directory with
name 'bellinih1'.

-> Soft links

are also known as symbolic links.
With symbolic links two files are different. One file contains the data and the other
file contains name of original file and acts as pointer or link to it.

One can also make symbolic links to directory, and they can cross different

Every symbolic link has its own inode, and each symbolic link uses an amount
of disk space.
If you delete symbolic link original file is not affected.
But if original file is deleted, link remains but no longer points to any data.
e.g: ln -s opera /export/home/nikkij/opera1
creates a soft link for file opera with name opera1 using -s option

ls -l
command gives the number of links for that particular directory or file in column 2.

rm /home/rule/compose/bellinih1
to remove the link you use rm command followed by filename



Post a Comment

Subscribe to Post Comments [Atom]

<< Home