Hard link and Symbolink link

Etienne Brun
Feb 3, 2021

Hardlink and Symlink are pointers to files.

The hard link is like a file, it’s just an extra pointer to the inode (The inode is a data structure in a Unix-style file system which describes a filesystem object such as a file or a directory).

The symlink is a separate file that stores a filesystem path to a file.

So if we delete, remove or rename the linked file, the hardlink will not be affected while the symlink will no longer have access to the path.

To create Hardlink in Unix, at the Unix prompt (A command prompt, also referred to simply as a prompt, is a short text message at the start of the command line on a command line interface), enter :

ls source_file linkfile

To create a symlink, you need to add the -s flag :

ln -s source_file linkfile

--

--