What is the difference between Hard link and Soft link in Linux

Posted: August 27, 2010 in Linux

Hard link:

– Hard link is the mirror copy of original file

– Same inode number for both Hard link and the original file

– Even if you delete any of the file, noting will happen to other file

– Hard link is not allowed for directory

– UNIX or Linux does not allow creating hard links across file system boundaries. Follow the URL to know more.

Soft Link:

– Soft link is the symbolic link(just like shortcut in windows) for original file

– Different inode number for soft link and original file

– If you delete the original file, the soft link fails.

– If you delete the soft link file, nothing happen to original file

– Soft link is allowed for directory

If you edit the original file, the same will reflect to both hardlink and softlink files.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s