Hard Link :
A hard link acts as a copy (mirrored) of the selected file. It accesses the data available in the original file.
If the earlier selected file is deleted, the hard link to the file will still contain the data of that file.
Soft Link :
A soft link (also known as Symbolic link) acts as a pointer or a reference to the file name. It does not access the data available in the original file. If the earlier file is deleted, the soft link will be pointing to a file that does not exist anymore.
Some notable differences between the two are listed below:
| Comparison Parameters | Hard link | Soft link |
|---|---|---|
| Inode number* |
Files that are hard linked take the same inode number. |
Files that are soft linked take a different inode number. |
| Directories |
Hard links are not allowed for directories. (Only a superuser* can do it) |
Soft links can be used for linking directories. |
| File system |
It cannot be used across file systems. |
It can be used across file systems. |
| Data |
Data present in the original file will still be available in the hard links. |
Soft links only point to the file name, it does not retain data of the file. |
| Original file’s deletion |
If the original file is removed, the link will still work as it accesses the data the original was having access to. |
If the original file is removed, the link will not work as it doesn’t access the original file’s data. |
| Speed | Hard links are comparatively faster. | Soft links are comparatively slower. |
Note:
- Inode number – Index node number is a unique number assigned to all files in a Linux/Unix system.
- Superuser – A superuser has more rights compared to an ordinary user. They can change file ownership and set permissions.
Diagrammatic representation:

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Recommended Posts:
- Difference between Soft Computing and Hard Computing
- Difference between Hard real time and Soft real time system
- Difference between Hard Copy and Soft Copy
- Difference between Hard Disk Drive (HDD) and Solid State Drive (SSD)
- Difference between Random Access Memory (RAM) and Hard Disk Drive (HDD)
- Difference between NP hard and NP complete problem
- Difference between Hard Disk and Floppy Disk
- Difference between Hard drives and Flash drives
- Difference between Memory and Hard Disk
- Difference between AI and Soft Computing
- Difference between Firm Real-time Tasks and Soft Real-time Tasks
- Difference between External link and Internal link
- Hard Disk Drive (HDD) Secondary memory
- Difference between Distance vector routing and Link State routing
- Difference Between High-level Data Link Control (HDLC) and Point-to-Point Protocol (PPP)
- How to create an HTML button that acts like a link?
- How to disable a link using only CSS?
- HTTP headers | Link
- HTML | DOM Link Object
- How to make whole row in a table clickable as link in Bootstrap ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

