티스토리 뷰

파일의 링크 두 종류 하드링크와 심볼릭 링크. 원본파일이 'inode1'을 사용하면 하드링크도 'inode1'을 사용하게되지만, 심볼릭 링크는 'inode2'를 만들어서 사용한다. 데이터는 원본파일과 연결된다. 윈도우의 바로가기 아이콘과 같은 개념.

 

There are two types of link; hard link and symbolic link. When original file uses 'inode1'. hard link uses 'inode1' as well, but symbolic link makes 'inode2' and links data to original file. Symbolic is same idea as shortcut icon in windows.

 

1. create /root/linktest and 'basefile' file inside the directory.

 

2. use 'ln' command to create hard link file and symbolic file.

=> ~]# ln basefile hardlink

      ~]# ln -s basefile softlink

 

 

 

youll see basefile and hardlink have same inode#, unlike softlink

 

 

3. Compare hard link and soft link

=> ~]# cat hardlink

 

 

4. Move original file to somewhere and compare those links again

 

 

Now you got the ideas of hardlink and symbolic link

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함