Free Hosting Tutorials

Hard link in Linux / UNIX

Both Linux / UNIX allows the data of a file to have more than one name in separate places in the same file system. Such a file with more than one name for the same data is called a hard-linked file.

ln command make links between files. By default, ln makes hard links.

# ln {source} {link}

Where,
=> source is an existing file

=> link is the file to create

Soft link in Linux / UNIX

A symbolic link (also known as a soft link or symlink) consists of a special type of file that serves as a reference to another file or directory. Unix/Linux like operating systems often uses symbolic links.

To create a symbolic link in Unix or Linux, at the shell prompt, enter the following command:

 #ln -s {target-filename} {symbolic-filename}

Main difference between hard link and soft link.

symbolic links: Refer to a symbolic path indicating the abstract location of another file
    hard links : Refer to the specific location of physical data.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.