In: Computer Science
Describe hard and symbolic links. What is the difference between them?
Hello,
Links are nothing but it just points to a file or we can say the pointer of the file or a directory in linux.
Links are of two types.
1. Symbolic links or soft link
2. Hard links
Main difference between these both links are that when you delete a file or move a file, symbolic links will also be removed. But in case of hard link, it will always keep that link to source file. So hard link will not be removed.
Hard link contains the file content while soft links containthe parh of original file.
As hard link contains the all content of file or directory, so we should avoid to create hard links for directory. Instead of that we have to use soft links.
We can not use hard link to link it with other files as it contains the file content while soft link can be used to link a file between whole system.
To create hard link:
ln original_file_name link_name
To create soft link:
ln -s original_file_name link_name
THAT'S IT FROM MY SIDE, IF YOU HAVE ANY DOUNT, COMMENT HERE AND IF YOU LIKE THIS ANSWER, GIVE ME A LIKE.