Tuesday, November 13, 2018

Hard Link vs Soft Link


Q.) Soft Link vs Hard Link

Soft Link:

Soft link is the link between files. It is more like shortcut in windows.

You delete a soft link and it does not effect the actual file or directory it is pointing to.

Inode of the linked file is different from inode of the original file.

Deleting original files makes the symlink dangling

Soft Link can link both the files as well as directories and can span across filesystems as well.

Diplayed in Console:
lrwxrwxrwx 12 12 root abc.txt->def.txt

How to create it:

ln -s <Source> <LinkName>

Hard Link:

Both hard link and the actual file share the same inode.

If source file deleted, then hard link still exists.

can not span across different filesystems

Can only link files, not directories.

How to create it:

ln <Source>  <Destination>


My GutHub basics and cheat sheat

used for Source control management (SCM). Following are the few things you need to know: 1. cloning - pulling down the copy of the sour...