# 🔗 **Linux Links: Soft Link vs Hard Link** ## 📝 **Types of Links** In Linux, there are **two types** of links: 1. ðŸŠķ **Soft Link** (Symbolic Link) 2. ðŸŠĻ **Hard Link** --- ## ⚙ïļ **Commands** ### ðŸŠķ **Soft Link (Symbolic Link)** Acts like a **shortcut** pointing to the original file. ```bash ln -s ``` ðŸ’Ą **Example:** ```bash ln -s file.txt file_link.txt ``` --- ### ðŸŠĻ **Hard Link** Points directly to the file's **inode** (physical data on disk). ```bash ln ``` ðŸ’Ą **Example:** ```bash ln file.txt file_hard.txt ``` --- ## 📊 **Soft Link vs Hard Link** | 🏷ïļ Feature | ðŸŠķ Soft Link (Symbolic) | ðŸŠĻ Hard Link | | ------------------------- | --------------------------------- | ----------------------------- | | ðŸ”Ē **Inode Number** | Different from the original file | Same as original file | | 🗂 **Cross Filesystem** | ✅ Yes | ❌ No | | ❌ **If Original Deleted** | Link breaks (becomes invalid) | File still exists | | ðŸ“Ķ **Storage** | Stores path to original file | Stores actual data reference | | 🔄 **Update** | Reflects changes in original file | Reflects changes (same inode) | --- ## 🧠 **Quick Notes** * **Soft Link** → Think *shortcut* 📎 * **Hard Link** → Think *clone reference* 📀 * If you delete the **base file**: * ðŸŠķ Soft Link → ❌ Broken link * ðŸŠĻ Hard Link → ✅ Still works (data intact)