Explaining Soft Link And Hard Link In Linux With Examples

Soft Link And Hard Link In Linux

26 Responses

  1. Kanika says:

    Very clearly explained.

  2. Mike says:

    Great explanation!!! Thanks

  3. chindesh says:

    Simple and clean. Thank you!

  4. Mohammed Firdosh Nasim says:

    Nice explanation. Requesting you to update the following “file permissions (lrwxrwxrwx vs lrwxrwxrwx)” in soft link section to in “file permissions (lrwxrwxrwx vs -rw-r–r–)” .

  5. Excellent explanation! Just a thought: a “mirror copy” implies that both source.file and hardlink.file use different disk space, thus occupping twice as much space (“a copy”), which is wrong.

    Both file names are just different entries in the directory listing to the same “data”, same disk space (identified by an inode), and Linux have a “link count” of file names in every inode. It only erases the inode data when the link count reaches zero.


  6. Sandeep says:

    Great explanation, just one questions, can you please explain that why do we need to create Soft Link or Hard Link, what is the purpose of creating these links. Can you please let me know one scenario for this? Thanks in advance

  7. Hema says:

    My question is, if we update the content in softlink will it reflect to the original file as well?

    • sk says:

      Check it yourself and see if it works. Open the shortcut file in a text editor, add some lines, save and close the file. Now check the contents of source file and symlink.

  8. Tin says:

    Something worth noting is that *editing* a hard linked file will still edit *all* linked files, since they’re actually the exact same file.

  9. Ghalib says:

    what about the size in soft link and hard link takes in time of creation.

  10. rajadurai m says:

    it is very useful to understand the beginners. Thank you

  11. akshay says:

    nice explanation

  12. Hmm it seems like your blog ate my first comment (it was super long) so I guess I’ll just sum it up what I wrote and
    say, I’m thoroughly enjoying your blog. I as well am
    an aspiring blog blogger but I’m still new
    to everything. Do you have any tips for novice blog
    writers? I’d certainly appreciate it. – Calator prin Romania

  13. Jenn says:

    This help me a lot, thanks <3

  14. Yen Lung says:

    Clearly and nicely explanation.

  15. Hantong Liu says:


  16. Pallavi Ghorpade says:

    Very much easy explanation to understand the concept clearly. Thank you so much

  17. ac-optimus says:

    this was really awesome, thanks!

  18. A.T. says:

    It’s very helpful for beginners. Merci !

  19. Gabriel says:

    I am a beginner in Linux (I use Ubuntu on a VM) and this was a very clear explanation for me.
    Now I really understand the differences between hard link and soft link. I have to go back to the terminal to test all new knowledges.
    Thank you for your time!

  20. Chirag Garg says:

    You have cleared every single doubt, Awesome 🙂

  21. iProcessor says:

    Under the “Creating Hard Link” section, thanks to change the word “softlink.file” into “hardlink.file” instead for the statement=>”Let us check the inode and permissions of softlink.file and source.file.” as I believe it was a typo error.

    Thanks 🙂

  22. Idris says:

    Excllent explanation and very usefull content.

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.