- Hard link/link: A filename in a directory is called a file hard link. The same file may have several links in the same directory/different ones (kinda like persistent shortcuts)
$ ln p1 p2
- Creates a new hard link with pathname “p2” for a file identified by “p1”
- Hard links cannot be for directories
- Hard links only exist for files in the same filesystem (eg. NTFS<->FAT32)
- Soft/Symbolic Link: Short files that contain arbitrary pathname of another file. Destination may be in any other system. (just a regular shortcut)
$ ln -s p1 p2
- Creates a new soft link with pathname p2 refering to p1
my-hard-link persists after moving myfile.txt while my-soft-link will be a broken shortcut