什么是符号链接与及怎么创建

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了什么是符号链接与及怎么创建相关的知识,希望对你有一定的参考价值。

引用来自:https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

Windows 10,8,7and Vista 都支持符号链接(symbolic link),即著名的symlinks-它指向你系统中的文件或者文件夹,你能创建他们使用这个命令行(command prompt ,admin priviledge)或者第三方工具叫做LINK SHELL Extension

EXCERPt:

  

What Are Symbolic Links?

Symbolic links are basically advanced shortcuts. Create a symbolic link to an individual file or folder, and that link will appear to be the same as the file or folder to Windows—even though it’s just a link pointing at the file or folder.

使用命令行怎么创建符号链接:

Without any extra options, mklink creates a symbolic link to a file. The below command creates a symbolic, or “soft”, link at Link pointing to the file Target :

mklink Link Target

Use /D when you want to create a soft link pointing to a directory. like so:

mklink /D Link Target

Use /H when you want to create a hard link pointing to a file:

mklink /H Link Target

Use /J to create a hard link pointing to a directory, also known as a directory junction:

mklink /J Link Target

技术分享图片

So, for example, if you wanted to create a hard link at C:\LinkToFolder that pointed to C:\Users\Name\OriginalFolder, you’d run the following command:

mklink /J C:\LinkToFolder C:\Users\Name\OriginalFolder

You’ll need to put quotation marks around paths with spaces. For example, if the folders are instead named C:\Link To Folder and C:\Users\Name\Original Folder, you’d use the following command instead:

mklink /J "C:\Link To Folder" "C:\Users\Name\Original Folder"

技术分享图片

If you see the message “You do not have sufficient privilege to perform this operation.”, you need to launch the Command Prompt as Administrator before running the command.

 

还有第三方工具用法查看原文:

以上是关于什么是符号链接与及怎么创建的主要内容,如果未能解决你的问题,请参考以下文章

iOS进阶 - 链接器:符号是怎么绑定到地址上的?

微信小程序代码片段

JS图片轮显代码里链接中带有“&”符号怎么正常显示

vscode用啥符号把某一段代码包起来,类似C#的#region?

刷机出现 检测到系统安装错误,[从WIM中提取文件是,无法创建硬链接或符号链接] 要怎么处理呢?

片段中的按钮自定义视图