DEV Community

Cover image for Linux Learning Journey – Day 3: Understanding Hard Links & Soft Links πŸ”—πŸ§
Avinash wagh
Avinash wagh

Posted on

Linux Learning Journey – Day 3: Understanding Hard Links & Soft Links πŸ”—πŸ§

πŸ”Ή Soft Link Demonstration

In the first screenshot, I created a soft (symbolic) link using:

  • ln -s Myfile.txt softlink

After listing the directory contents with ls, the symbolic link appeared alongside the original file.
Using cat softlink confirmed that the soft link correctly points to the original file and displays its content.

This demonstrates that:

  • A soft link references the file path
  • It behaves like a shortcut
  • It depends on the existence of the original file

πŸ”Ή Hard Link Demonstration

In the second screenshot, I created a hard link using:

  • ln File.txt hardlink-file

After listing the files, both names appeared as independent entries.
Running cat hardlink-file showed the same content as the original file, proving that both filenames point to the same inode (actual data).

This confirms that:

  • Hard links directly reference the same data on disk
  • Deleting one filename does not remove the data as long as another hard link exists
  • Changes via one link affect the other

πŸ“Œ Reflection & Next Step

Some days are about depth, not speed.
Understanding hard and soft links improved my clarity on how Linux manages files internallyβ€”an essential skill for real-world systems.

Day 4 continues the journey with more core Linux concepts that strengthen daily command-line confidence.

Thanks for reading πŸ™Œ
See you in Day 4 πŸ§πŸš€

Top comments (0)