What is the difference between a hard link and a symbolic link?

What is the difference between a hard link and a symbolic link?

-What is a Soft link?: a sof link also known as symbolic link works as a pointer, basically points/links to the file path or direction.

-What is a Hard link?: a hard link is connected with the file throught the inode which stores essential information about the file itself such as it’s location, creation date, permissions and other attributes.

-How to create them:

Create a Hard link:

ln?File Hardlinktofile        

Create a Soft link:

Symbolic links are also created with the command?ln, but for the link to be soft we need to specify the parameter?-s, to create a symbolic link to the file Filesoft called Softlinktofile run:

ln?-s?Filesoft Softlinktofile        

?-What is the difference between them?

  • A hard link always points a filename to data on a storage device.
  • Whereas a soft link always points a filename to another filename, which then points to information on a storage device.
  • If you delete the file which soft link is linking, then it has no value, as it would be pointing to a non-existent file however the hard link, as it works as a mirror copy of the file, would still work even thought the original file has been deleted.

I hope you found this article useful to understand the differences between hard links and symbolic links and how to create them.Thanks for reading!




要查看或添加评论,请登录

Juan Giménez的更多文章

  • Portfolio Project HandSafety VR

    Portfolio Project HandSafety VR

    This blog is about our final project: HandSafety VR at Holberton's foundation program. Our project helps users learn…

  • Explaining a STEM role (machine learning)

    Explaining a STEM role (machine learning)

    During this blog, I will explain what an ML developer does. What does “STEM” mean? It stands for “science, technology…

  • What happens when you type google.com in your browser and press Enter

    What happens when you type google.com in your browser and press Enter

    Have you ever wondered what happens when you type an URL and press enter? This blog post will explain what is going on…

  • Explaining IoT

    Explaining IoT

    Introduction: In this blogpost i will be explaining what IOT is and how it affects our daily life as well as security…

  • Features to consider when buying a new smartphone

    Features to consider when buying a new smartphone

    The sheer number of choices can often leave you confused. Therefore, making a decision becomes difficult.

  • Recursion: A Picture is Worth 1,500 Words

    Recursion: A Picture is Worth 1,500 Words

    In this blog, I will be explaining the concept of recursion through a drawing, below there is a function that returns…

  • Python 3: Mutable, Immutable... everything is an object!

    Python 3: Mutable, Immutable... everything is an object!

    Introduction: Yesterday, at Holberton, we did a project ( in python) that explained some important deep concepts about…

  • Static and Dinamic libraries in c

    Static and Dinamic libraries in c

    Why use libraries in general and how do they work? As a programmer, you may find yourself using the same function or…

  • What happens when you type `ls *.c` into your shell

    What happens when you type `ls *.c` into your shell

    (Note: This post assumes you are aware of the general concepts of files, directories, filename extensions, terminal…

社区洞察

其他会员也浏览了