PoiNtEr->: How to create soft link with ln command in linux

                             Difference between a dream and an aim. A dream requires soundless sleep, whereas an aim requires sleepless efforts.

Search This Blog

Sunday, August 14, 2011

How to create soft link with ln command in linux


To make links between files you need to use ln command. 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.
Two types of links

There are two types of links

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


                            

How do I create soft link / symbolic link?

To create a symbolic link in Unix or Linux, at the shell prompt, enter the following command:
ln -s {target-filename} {symbolic-filename}

For example create softlink for /home/vishal/Desktop/syllabi.pdf as /home/vishal/study/syllabi1.pdf, enter the following command:
ln -s /home/vishal/Desktop/syllabi.pdf  /home/vishal/study/syllabi1.pdf
ls -l /home/vishal/Desktop/syllabi.pd
f


Output:

lrwxrwxrwx 1 vishal  vishal    16 2011-08-12 22:53 syllabi1.pdf -> /home/vishal/Desktop/syllabi.pdf

No comments:

Post a Comment