Author : Piyush Gupta
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.
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?
Soft links are created with the ln command. For example, the following would create a soft link named link1 to a file named file1, both in the current directory
To verify new soft link run:
Use following command to create a soft link of Apache configuration file under /etc directory. While creating softlink of file inode number will be different that original file.
Check soft link and original file inode number.
How do I create Hard link?
Use following command to create a hard-link of Apache configuration file under /etc directory. While creating hard-link of file inode number will be same as original file.
Check soft link and original file inode number.
No comments:
Post a Comment