LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   files (https://www.linuxquestions.org/questions/linux-newbie-8/files-705093/)

palisetty_suman 02-16-2009 11:31 AM

files
 
Hey can anybody say the difference between hard link file and soft link files with example. Please don't suggest any websites. I want your knowledge because that helps me to understand better than the website. Thanks.

repo 02-16-2009 11:44 AM

http://www.linuxquestions.org/questi...d-link-424007/

bach-fiend 02-16-2009 03:33 PM

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.

palisetty_suman 02-16-2009 11:01 PM

Thanks
 
Thanks friends. Awesome reply. i got it.


All times are GMT -5. The time now is 12:07 AM.