
Even though they're separate files with different names, and are located in different places, changing the original data alters both files: that's how hard links work. If you go down to the Inode level and change the data down there - the spot that both File 1 and 2 are pointing to - both files change. That happens because they're two separate files, but they're pointing to the exact same spot on the hard drive. Because there's an exception to the idea that they behave like separate files: if you make a change to File 1, File 2 will automatically be edited. But it's better that you don't think of a hard link as a copy. And because it's a hard link, it points to the exact same spot on the hard drive.Įffectively, a hard link gives you two, separate files that behave like different files. But when you open File 2, the data is the same as File 1. Because it's a hard link, it's a new file - we'll call it File 2. Now imagine you create a hard link to File 1. Change the data on the hard drive and File 1 changes too. Now imagine a file - let's call it File 1 - that points to that specific point on the hard drive where the data is stored. Imagine hard enough and you can just see the space it occupies on the hard drive. If you imagine a hard drive down to the Inode level, you can imagine the data that a file represents. A soft link isn't a separate file, it points to the name of the original file, rather than to a spot on the hard drive. A hard link is a file all its own, and the file references or points to the exact spot on a hard drive where the Inode stores the data. In Linux systems, the data structure that does the actual storing of information is called an Inode. Understanding the difference between a hard link and a soft link takes zooming in on a hard drive as far down as we can go. The difference comes down to what they're referencing: hard links refer to the data itself, soft links point to the path to the data. Both soft links and hard links point to files, but there's a key difference between them. Hard links and soft links are terms used in Linux and OS10 operating systems. How are Hard Links and Soft Links Different? These are essentially two different ways that files are referenced on a hard drive, with the former pointing to the file itself and the latter directed towards the name of the file. In this video, Shawn Powers covers the difference between hard links and soft (or symbolic) links on a Linux OS 10 operating system. The distinguishing characteristic of a hard link from a soft link is that deleting the original file doesn't affect a hard link, while it renders a soft link inoperable.

A hard link is a mirror copy of the original file. Quick definition: In the Linux operating system, a hard link is equivalent to a file stored in the hard drive – and it actually references or points to a spot on a hard drive. Because the connection is a logical one, and not a duplication, soft links can point at entire directories or link to files on remote computers.
#UNIX LINK LN WINDOWS#
In Windows vocabulary, you could think of it like a shortcut. Quick definition: In Linux, a soft link, also known as a symbolic link, is a special sort of file that points at a different file. Soft links, hard links, and more are covered in our Linux training module. Hard links and soft links are particular to Linux and other Unix-like OSs, but understanding them can help you navigate the filesystems of the Linux operating system.
#UNIX LINK LN FULL#
Full of terms and phrases, learning to use the OSis made even more challenging by the fact that some of its words it borrows from other systems, while others apply only to Linux. The Linux operating system is no different. One of the most important aspects about learning a new technology or tool is understanding its terminology.
