• Hard links point to the same inode;
        • ls -li # see the inodes of files & links

 

      • Soft links point to file name. If the name of the file changes, the soft link breaks.

 

Creating a hard link:

ln file.txt hardlink.txt

 

Creating a symbolic link:

ln -s file.txt softlink.txt

 

Since hard links are tied to inodes, there cannot be hard links across file systems.

Links are useful to link often edited config files, located in some faraway nested directory, to somewhere up close, like for example the user /home directory.

While creating symbolic links, it is good practice to specify full path to source file.