Hard links and Symbolic links — easy explanation

Difference between hard link and symbolic link references

Hard and symbolic links refer to a file in the same hard drive and those methods are part of any filesystem that organizes what it is in each file and where. A hard link is usually a synced copy of a file that refers directly to the inode of a file. Symbolic links, on the other hand, direct to the file which refers to the inode which is a shortcut.

What is an inode:

What is a hard link?

Creating the first file ‘test’ before making a hard link test2

In the previous screenshot, the hard link to a file is created using the command line to create a hard link named test2 with the command ‘ln test test2’

The file ‘test’ should be empty but the file ‘test2’ will contain some text: “Holberton is awesome”,

Opening test 2 with Holberton is awesome! in it

Now the change from the hard link made in ‘test2' is reflected in the original file ‘test’ as is shown in the following

The change from the hardlink is reflected in the original file

I have changed the original file via the hard link by adding “Holberton is awesome”. By opening the original file, the word “Holberton is awesome” is already in there.

What are symbolic links: