Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Understanding Hard Links vs Soft Links

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 409
    Comment on it

    In Linux or Unix based OS create file into two parts ::

    1. Data part : it contains the information regarding the iNode number of the file along with the variuos permission on that file.

    2. Filename part : contains the name of file and inode number of the file.

    What is a HardLink : If two filenames point to same iNode number than those files are said to be hardlinked. To create a HardLink linux uses following command-

    ln 'path/of/file/to/create/hardlinkof' 'path/where/to/create/hardlink'  

    The problem with hardlinks is that :

    1. it can only work for the files that are in  same file system.

    2. The file which has to be hardlinked must preexist .

    3. Hardlinks doesnot work upon directories.

    On the other hand Softlinks can be described as a file whose data part contains path to another file. Softlinks overcome the problems of hardlinks mentioned above.

    ln -s 'path/of/file/to/create/hardlinkof' 'path/where/to/create/hardlink'  

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: