|
Answer» Hard Links: It is a special kind of file that points to the same underlying inode as another file. It can be referred to as an ADDITIONAL name for an existing file on Linux OS. Total number of hard links for a file can be displayed using the “ls -l” command. Such links cannot be used across file systems. Hard links can be CREATED using the following command: $ ln [original filename] [link name]
Soft Links: It is also TERMED a symbolic Link. Soft links are kinds of FILES that usually point to another file. It does not include any amount of data in the target file and simply points to another entry anywhere in the file system. Such links can be used across file systems. Soft links can be created using the following command: $ ln -s [original filename] [link name] | Hard Links | Soft Links |
|---|
| It is considered a mirror copy of the original file. | It is considered a symbolic link to the original file. | | It usually shares the same inode number. | It usually shares different inode numbers. | | It contains the original contents of the files. | It does not contain the actual contents but contains the location of the original file. | | Any changes made to the original file will directly reflect other files. | Any changes or modifications made to the soft link will directly reflect the original file and its hard links. | | It cannot be used for linking directories. | It can be used for linking directories. | | Such links are faster as compared to soft links. | Such links are slower as compared to hard links. |
|