What is the difference between a hard link and a symbolic link?
In linux systems a links is way to create a shortcut for a original directory, so we can create a convenient path from another place in the system, there are two ways to do it
Hard Links
A hard link create a file that should point to the same inode which means points to the same place where the original file was created
Symbolic Links
Symblinks creates a reference to a file/folder but no to the same inode, which means it will point only to the file
We can remove or modify a hard link and will continue to point to the same content, no matter what happens, on the other hand the symbolic link now points to nothing because the original file change
an example on how can create a hard links is whit this command
ln original_file hard_link
the hard_link will always point to the inode of original_file they have the exact same contents, you can’t use symbolic links for directories
to create a symbolic link we need to put this command
ln -s original_file symb_link
the “-s” will make symb_link a symbolic link to orginal_file, it works like a direct access, you can use symbolic links for directories