Abstract


  • It is like hyperlink on the webpage, that links up the components of File System

# Create a hard link to a file:
ln /path/to/file path/to/hardlink

Space saving

We can have multiple references to a single set of data without duplicating the data. Like an additional name for an existing piece of data on disk. Deleting one hard link does not delete the data, as long as other links to that data remain

Important

When we create a Hard link on Soft (Symbolic) File System Link, we create a direct link to the existing piece of data on disk, so independent of the soft file system link.


# To create a symlink:
ln -s <source-location> <symlink-location>
 
# To symlink, while overwriting existing destination files
ln -sf <source-location> <symlink-location>

Can be used to manage dotfiles

Tools like GNU Stow helps to manage dotfiles in one place in an organised manner, and we can version control it with Git. Refer to Stow has forever changed the way I manage my dotfiles for more details

Useful Commands


realpath

realpath path/to/file_or_directory