1- What is the inode ?
An inode is a data structure (i.e., an optimized way of storing information) that stores all the information about a file (e.g., its size, its access permissions, when it was created and where it is located on the system) except its name(s) and its actual data. The fact that inode numbers are unique only within any filesystem is the reason that they do not work across filesystems and partitions.
2- What is the hard link ?
Any number of hard links, and thus any number of names, can be created for any file. Hard links can also be created to other hard links. However, they cannot be created for directories, and they cannot cross filesystem boundaries or span across partitions.
# How to create it ?
Hard links are created with the ln command. For example, the following would create a hard link named hlink1 to a file named file1, both in the current directory (i.e., the directory in which the user is currently working):
$ ln file1 hlink1
3- What is the symbolic link ?
In computing, a symbolic link (also symlink or soft link) is a term for any file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.
# How to create it ?
Soft links are created with the ln command. For example, the following would create a soft link named link1 to a file named file1, both in the current directory
$ ln -s file1 link1
4- What is the difference between the hard and symbolic links
A hardlink isn’t a pointer to a file, it’s a directory entry (a file) pointing to the same inode. Even if you change the name of the other file, a hardlink still points to the file. If you replace the other file with a new version (by copying it), a hardlink will not point to the new file. You can only have hardlinks within the same filesystem. With hardlinks you don’t have concept of the original files and links, all are equal (think of it as a reference to an object). It’s a very low level concept.
On the other hand, a symlink is actually pointing to another path (a file name); it resolves the name of the file each time you access it through the symlink. If you move the file, the symlink will not follow. If you replace the file with another one, keeping the name, the symlink will point to the new file. Symlinks can span filesystems. With symlinks you have very clear distinction between the actual file and symlink, which stores no info beside the path about the file it points to.