Hard and symbolic links
Links enable you to create an association between two files or directories. This is useful for maintaining multiple versions of a file or directory without the overhead of additional disk space for storing multiple copies. Links can either be hard or symbolic and we can use
ln to create a link between two files.
By default, the ln command will create a hard link between these files. Hard links create an identical copy of the linked file on disk that gets updated automatically as the source file gets updated. While the content of the two files are linked, if the source file gets deleted, the target file will continue to exist as an independent file. An important thing to note about hard links is that they only work on the current file system. You can’t create a hard link to a file on a different file system. Also, hard links don’t work for directories. You can however overcome these issues by using the -s switch to create a symbolic link.