Back
ln command is used to create Linked files.
Linked files allow users to edit the same file from different directories. When linked files are devices, they may represent more common names, such as /dev/dvd. Linked files can be hard or soft.
Hard links include a copy of the file. As long as the hard link is made within the same partition, the i-node numbers are identical. You could delete a hard-linked file in one directory ,and it would still exist in the other directory.
# ln /etc/samba/smb.conf smb.conf
Command creates the hard link from the actual samba configuration file to smb.conf in the local directory.
On the other hand, a soft link serves as a redirect, when you open a file created with soft link, the link redirects you to the original file. If you delete the original file, the file is lost. While the soft link is still there, it has nowhere to go. The following command is an example of how you can create a soft linked file.
# ln -s /etc/samba/smb.conf smb.conf
i-nodes are data structures of a filesystems used to store all the important properties of each file: size, owner's user id and group id, access permission and more.
The important thing is that each named data area on your disk must have an i-node, and when you create a new data file this means creating an i-node.
But when you're using hard links, you're effectively creating filesystems directory entry, which references an already existing data, so the hard link gets the same i-node number pointing to the same data.
ln command is used to create Linked files.
Linked files allow users to edit the same file from different directories. When linked files are devices, they may represent more common names, such as /dev/dvd. Linked files can be hard or soft.
Hard links include a copy of the file. As long as the hard link is made within the same partition, the i-node numbers are identical. You could delete a hard-linked file in one directory ,and it would still exist in the other directory.
# ln /etc/samba/smb.conf smb.conf
Command creates the hard link from the actual samba configuration file to smb.conf in the local directory.
On the other hand, a soft link serves as a redirect, when you open a file created with soft link, the link redirects you to the original file. If you delete the original file, the file is lost. While the soft link is still there, it has nowhere to go. The following command is an example of how you can create a soft linked file.
# ln -s /etc/samba/smb.conf smb.conf
i-nodes are data structures of a filesystems used to store all the important properties of each file: size, owner's user id and group id, access permission and more.
The important thing is that each named data area on your disk must have an i-node, and when you create a new data file this means creating an i-node.
But when you're using hard links, you're effectively creating filesystems directory entry, which references an already existing data, so the hard link gets the same i-node number pointing to the same data.