On 26 Dec, Doug McGarrett wrote:
A recent thread brought up the question of a symbolic link --I guess that's sl, or would it be sl, versus what it called a "real" link, which I believe is ln. I would really like to see a little help here. Somebody knows links? Thanx. --doug
The file system identifies data using something called an "inode". The file names you see in a directory point to an inode with the file's data. For example, the file /etc/config-file might have an inode of 123456789. When you type in the command "mv /etc/config-file /usr/local/etc/config-file", Linux does not move any of the file's data. It just copies the directory entry that points to inode 123456789 to /usr/local/etc. The command "ln /usr/local/etc/config-file /opt/gnome/etc/config-file" creates a pointer to inode 123456789 in /opt/gnome/etc. This is a hard link: two directory entries point to the same inode. Both file names point to the same file data. You can "rm /usr/local/etc/config-file" and /opt/gnome/etc/config-file will still contain the data. A file's data is only deleted when there are no more pointers to its inode (hard links). There are some limitations to hard links: they do not work across partitions, and they do not work for directories. In these cases you need soft links. The soft link is a reference to the target path. It does not depend on inodes. So soft links can point to directories, or files on another partition. With a soft link, the referenced file may be deleted. That creates a "broken link". The soft link still exists, but the file contains no data. Hope that helps... -- Robert Wohlfarth rjwohlfar@galaxyinternet.net "Is not life more important than food, and the body more important than clothes?" -- Matthew 6:25b