码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-12-05 17:35:05      阅读:775      评论:0      收藏:0      [点我收藏+]

标签:round   users   symlink   ext   creates   extension   lin   分享   this   

引用来自: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.

 

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

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

标签:round   users   symlink   ext   creates   extension   lin   分享   this   

原文地址:http://www.cnblogs.com/ZHMhello/p/7988058.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!