Monday, 2 December 2013

How Links works In Linux Red Hat

Link :- Link is a linked or copy file of the original file or source file.If we are change in the  link file the change automatically perform in the source or original file.And If we are delete the linked file our original file is safe that not be deleted .

 Links are two types 
1 Hard link
2 Soft link

Difference between soft link and hard link

1 Hard link :- Hard linked file size and original file size is same on disk.Inode number both are same.If we are delete the original file our link still working or accessible.Hard link can not be created on different part- ions.Link file does not show that is a link file.

2 Soft link :- Soft link file size is less than original file.Inode number both are different.If we are delete the original file link is not working.the soft link file color and permission define its a linked file of original file.   

* How to create Hard links of files
Setup 1 :- Select the file or make the file which you are using to make a link file. In my case i make a file name link with the command touch.
syntax :- touch link


Setup 2 :- Now we are going to make link file of the file which name is link in my case.
             Syntax :- ln <source>  <destination>            
 (source =  Which file you want to make copy or linked file )         
  (destination = where you want  to save your link file)

Now your hard link is created and you are able to use this file  as link and check the inode or size with the command of ls -l.Those are same in hard link.And you check the all points Which are mention on the top.


* How to create the Soft link
Setup 1 :-  As same create a file of hard link or choose  Hard link

Setup 2 :- We are using the ln command for creating the soft link.
              Syntax :- ln -s <source> <destination>
Setup 3 :- Now Your soft link is ready to use .
                Check the color or Inode number or size of file by the command ls -l
Thanks for  reading  and sorry for my R.I.P english  _/\_

0 comments:

Post a Comment