Search

Wednesday, July 8, 2015

What is difference between hard link and soft link in UNIX?

There are two types of links in UNIX system, hard link and soft links, also known as symbolic link or symlink. Though both points to some other source, there are a lot of difference between them. hard link is direct pointer to the inode of the original file. If you compare the original file with the hard link there won't be any differences between them. On other hand, a soft link is a file that have the information to point to another file or inode. That inode points to the data in the disk. Hard links are much more restrictive than soft links and that's why they are used rarely. Also not all file systems supports hard links but UNIX does. Earlier Windows file system doesn't support soft links but from Windows 2000 onward they are supporting it, both Windows Vista and Windows 7 support links now. MS DOS operating system doesn't support neither hard link nor soft link. You can use ln command in UNIX to create, update and remove soft links. I often use links for build and release management purpose e.g. our application never points to hard-coded file or directory instead it points to links which is updated on every release.
Read more »

No comments:

Post a Comment