ln command is used for linking files and directories to each other in a Unix/Linux environment. ln allows any number of new names to be created, all pointing to the same file or diretory. You can then use any of these names to operate with the original file's data.
Two types of links ln can create
- hard link – association of a new file name with the inode for the original file
- symbolic link (symlink) – association of a new file with the path to the original file
The biggest difference is that hard link points to the actual file data, and removing it would remove that data (similar to removing the original file it's pointing to), while symlink will only remove the pointer to the original file, but not the file itself.
So hard link is a new name, but not a new filesystem entry. Symlink is both new name and a new filesystem entry, that's why it can be removed without removing original file. While we're on this topic, the original file can also be removed without touch symlink – this would result in the broken symlink (beause it will be pointing nowhere).