Hard vs Symbolic Links
When learning the foundations of coding, it is vital to understand the distinction between hard and symbolic links. While both seem similar on the surface, there are noteworthy differences that will absolutely help in projects down the road.
When the ln command is implemented, a hard link is created by default. This will allocate a separate space in memory for the space of the original file. This will have its own inode, and can be run independently of the original. There are many uses for hard links, but one of the key points to remember is that it needs significantly more memory than a symbolic link.
With symbolic links, also known as soft links, the -s argument is used. This notifies the ln command that the desired outcome is a symbolic link. While created using the same command, symbolic links are quite different from hard links. One of the firs points to note, symbolic links are just that, a link. It is just a connection to the original file, not a copy of one that we see with hard links. If the original is deleted, the symbolic link becomes unusable. In order for information to be read from a symbolic link, it has to communicate with the original file to display its contents. With this in mind, it also takes up significantly less memory. It merely gestures to the memory address of the original, rather than allocating a whole separate chunk for a copy of it.
Despite being full of differences, there are a great number of similarities. For instance, if the original file is updated, both hard and symbolic links will retrieve the update. No matter which link is chosen, nothing can help more than checking out man ln.