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

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

In linux systems a links is way to create a shortcut for a original directory, so we can create a convenient path from another place in the system, there are two ways to do it

Hard Links

A hard link create a file that should point to the same inode which means points to the same place where the original file was created

Symbolic Links

Symblinks creates a reference to a file/folder but no to the same inode, which means it will point only to the file

We can remove or modify a hard link and will continue to point to the same content, no matter what happens, on the other hand the symbolic link now points to nothing because the original file change

an example on how can create a hard links is whit this command

ln original_file hard_link

the hard_link will always point to the inode of original_file they have the exact same contents, you can’t use symbolic links for directories

to create a symbolic link we need to put this command

ln -s original_file symb_link

the “-s” will make symb_link a symbolic link to orginal_file, it works like a direct access, you can use symbolic links for directories

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

Yesid Gonzalez的更多文章

  • Create and publish an NPM package (using NX)

    Create and publish an NPM package (using NX)

    Using "NX" we are going to set up a basic project with a small REACT library that you can deploy to npm. Nx is a smart,…

  • What problems do UX designers solve?

    What problems do UX designers solve?

    User experience is a broad discipline because you must have skills in many different fields or at least know a little…

  • WEB Postmortem

    WEB Postmortem

    A postmortem is a process intended to help you learn from past incidents. It typically involves analysis or discussion…

  • Pow recursion explained

    Pow recursion explained

  • What Happens When You Type in a URL in your browser

    What Happens When You Type in a URL in your browser

    Let's say that you are sitting at your computer, surfing the Web, and you get a call from a friend who says, "check…

  • Do you need the Internet Of Things?

    Do you need the Internet Of Things?

    Maybe you hear about the terms "internet of things" and "artificial intelligence" and you think that is something magic…

  • Basics of Machine Learning

    Basics of Machine Learning

    In these days where the world is interconnected, maybe you hear some terms like Artificial Intelligence Machine…

  • Everything is an object!

    Everything is an object!

    Object-oriented programming refers to a type of computer programming software design in which programmers define not…

  • How object and class attributes work.

    How object and class attributes work.

    What’s a class attribute A class attribute is a Python variable that belongs to a class rather than a particular…

  • Dynamic Libraries C

    Dynamic Libraries C

    Library functions in C language are inbuilt functions which are grouped together and placed in a common place called…

社区洞察

其他会员也浏览了