Let me guess: by soft link do you mean symlink, like a Windows shortcut?
A symlink only stores the pathname of a "real" file that can be on a different volume etc. If you move the file, you "break" the symlink. It now points at where the file WAS, not where you moved it to.
The other kind of link is often called a "hard link." In a classic unix filesystem, when the disk is formatted, its space is divided between a table of "inodes" and the space normally used for holding files' data. Every real file on the disk has exactly one inode. A directory basically maps a name within that directory to an inode number. If you tell the system to link x/y/z to /a/b/c, you are saying to take the same inode number as /a/b/c and put it in the directory x/y for name z.
You can only (hard) link files that are on the same filesystem.
There is no difference between a hard link and the "original" file. The directory entries both specify the inode number of the file, so you can think of the inode as the "real" name of the file.
The ls -l command tells how many hard links there are to each file. Some other option will list the inode number the filename in the directory points to.
|