출처 :: http://my.jhlabs.org/60



리눅스의 파일시스템에서 자체 지원하는 심볼릭 링크는 아주 유용한 기능이다.
이제 윈도우 비스타 및 Windows Server 2008에서도 심볼릭 링크 기능을 자체 내장하게 되었단다.

바로 mklink 명령어를 이용하면 된다.


Description of 'mklink' command

C:\test>mklink

Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target
/D Creates a directory symbolic link. Default is a file symbolic link. /H Creates a hard link instead of a symbolic link. /J Creates a Directory Junction. Link specifies the new symbolic link name. Target specifies the path (relative or absolute) that the new link refers to.

Creating a symbolic link to a file

C:\test>mklink foo c:\Windows\system32\notepad.exe

symbolic link created for foo <<===>> c:\Windows\system32\notepad.exe

C:\test>dir

Volume in drive C has no label.
Volume Serial Number is 2211-7428

Directory of C:\test
04/14/2006 11:24 AM <DIR> . 04/14/2006 11:24 AM <DIR> .. 04/14/2006 11:24 AM <SYMLINK> foo [c:\Windows\system32\notepad.exe] 1 File(s) 0 bytes 2 Dir(s) 69,238,722,560 bytes free

Creating a symbolic link to a directory

C:\test>mklink /d bar c:\windows

symbolic link created for bar <<===>> c:\windows

C:\test>dir

Volume in drive C has no label.
Volume Serial Number is 2211-7428

Directory of C:\test
04/14/2006 11:24 AM <DIR> . 04/14/2006 11:24 AM <DIR> .. 04/14/2006 11:24 AM <SYMLINKD> bar [c:\windows] 04/14/2006 11:24 AM <SYMLINK> foo [c:\Windows\system32\notepad.exe] 1 File(s) 0 bytes 3 Dir(s) 69,238,722,560 bytes free

Deleting a symbolic link to a file

C:\test>del foo

C:\test>dir

Volume in drive C has no label.
Volume Serial Number is 2211-7428

Directory of C:\test
04/14/2006 11:24 AM <DIR> . 04/14/2006 11:24 AM <DIR> .. 04/14/2006 11:24 AM <SYMLINKD> bar [c:\windows] 0 File(s) 0 bytes 3 Dir(s) 69,238,722,560 bytes free

Deleting a symbolic link to a directory

C:\test>rmdir bar

C:\test>dir

Volume in drive C has no label.
Volume Serial Number is 2211-7428

Directory of C:\test
04/14/2006 11:24 AM <DIR> . 04/14/2006 11:24 AM <DIR> .. 0 File(s) 0 bytes 2 Dir(s) 69,238,722,560 bytes free

신고
Posted by Leo 리오 트랙백 0 : 댓글 0