[Linux](Command)ln - make links between files
업데이트:
Purpose
The ln utility creates a new directory entry (linked file) which has the same modes as the original file.

hardlink
하드 링크를 생성하면 하드링크 파일이 생성되고 원본 파일과 같은 inode를 사용한다.
사용법
ln basefile.txt hardlink.txt
inode 보는 명령어
ls -il [filename]
- Create hardlink
- Check inode

softlink (symbolic link)
소프트 링크를 생성하면 새로운 inode를 생성하고, 데이터는 원본 파일에 연결한다.
사용법
ln -s basefile.txt softlink.txt
- Create softlink
- Check inode


원본 파일이 변경되면 softlink로 찾을 수 없다.

option
-s : 소프트 심볼릭링크
-f : 강제 처리 옵션 (기존에 링크가 존재할 경우)
댓글남기기