What is the difference between a hard link and a symbolic link?
In Unix-like operating systems such as Linux, “everything is a file” and a file is fundamentally a link to an inode (a data structure that stores everything about a file apart from its name and actual content).
A hard link is a file that points to the same underlying inode, as another file. In case you delete one file, it removes one link to the underlying inode. Whereas a symbolic link (also known as soft link) is a link to another filename in the filesystem.
Read Also: How to Perform File and Directory Management
Another important difference between the two types of links is that hard links can only work within the same filesystem while symbolic links can go across different filesystems.

Looking at the output above, using ls command, the new file is not indicated as a link, it is shown as a regular file. This implies that
tp
is just another regular executable file that points to the same underlying inode as topprocs.sh
.
To make a hard link directly into a soft link, use the
-P
flag like this. To create a hard links in Linux, we will use ln utility. For example, the following command creates a hard link named tp
to the file topprocs.sh
.
No hay comentarios:
Publicar un comentario