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.pdf
Output:
lrwxrwxrwx 1 vishal vishal 16 2011-08-12 22:53 syllabi1.pdf -> /home/vishal/Desktop/syllabi.pdf
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.pdf
Output:
lrwxrwxrwx 1 vishal vishal 16 2011-08-12 22:53 syllabi1.pdf -> /home/vishal/Desktop/syllabi.pdf
No comments:
Post a Comment