日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > windows >内容正文

windows

在Windows Vista中使用符号链接

發(fā)布時(shí)間:2023/12/9 windows 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 在Windows Vista中使用符号链接 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

One of the long-awaited features in Windows Vista was the ability to use symbolic links, the way you can in linux. Sadly, they don’t work quite as well as they could, but it’s a big upgrade from prior versions, and has solved a number of problems for me already.

Windows Vista中人們期待已久的功能之一就是能夠使用符號(hào)鏈接,這是在Linux中的一種方式。 令人遺憾的是,它們的運(yùn)行狀況不盡如人意,但這是對(duì)先前版本的重大升級(jí),并且已經(jīng)為我解決了許多問題。

使用mklink命令 (Using the mklink Command)

The command that you need to use is mklink, which you’ll use from the command line. Just type it on the command line to see the options:

您需要使用的命令是mklink ,您將在命令行中使用它。 只需在命令行上輸入即可查看選項(xiàng):

C:\Users\geek>mklink Creates a symbolic link.MKLINK [[/D] | [/H] | [/J]] Link Target/D Creates a directory symbolic link. Default is a filesymbolic 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 linkrefers to. C:\Users\geek>mklink Creates a symbolic link.MKLINK [[/D] | [/H] | [/J]] Link Target/D Creates a directory symbolic link. Default is a filesymbolic 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 linkrefers to.

For instance, if you wanted to make the folder C:\Users\Geek\TestFolder available from C:\TestFolder as well, you could use the following command.

例如,如果您還想使文件夾C:\ Users \ Geek \ TestFolder也可以從C:\ TestFolder使用,則可以使用以下命令。

C:\mklink /D C:\TestFolder C:\Users\Geek\TestFoldersymbolic link created for C:\TestFolder <<===>> C:\Users\Geek\TestFolder

C:\ mklink / DC:\ TestFolder C:\ Users \ Geek \ TestFolders為C:\ TestFolder創(chuàng)建的符號(hào)鏈接<< === >> C:\ Users \ Geek \ TestFolder

Now if you look in C:\TestFolder directory, you’ll see whatever files were in the other directory.

現(xiàn)在,如果您查看C:\ TestFolder目錄,您將看到另一個(gè)目錄中的所有文件。

了解選項(xiàng)。 (Understanding the Options.)

MKLINK link target

MKLINK鏈接目標(biāo)

Using the command without any extra options creates a soft link to a file.

使用不帶任何其他選項(xiàng)的命令會(huì)創(chuàng)建到文件的軟鏈接。

/D creates a symbolic link, or a soft link.

/ D創(chuàng)建符號(hào)鏈接或軟鏈接。

This essentially acts like a shortcut to a folder in prior versions of Windows, except you don’t have to use an actual shortcut.

在本質(zhì)上,這與Windows早期版本中的文件夾快捷方式一樣,除非您不必使用實(shí)際的快捷方式。

/H creates a hard link, which points directly to the file.

/ H創(chuàng)建一個(gè)硬鏈接,該鏈接直接指向該文件。

This option can’t be used for folders directly for some reason, you’ll have to use the next option.

由于某些原因,該選項(xiàng)不能直接用于文件夾,您必須使用下一個(gè)選項(xiàng)。

/J creates a “Directory Junction”

/ J創(chuàng)建一個(gè)“目錄連接”

A Directory Junction?is actually just a hard link to a directory. This is a feature that existed prior to Vista as well.?If you are trying to symlink to a directory using a hard link, then you should use this option.

目錄連接實(shí)際上只是到目錄的硬鏈接。 這是Vista之前也存在的功能。 如果嘗試使用硬鏈接符號(hào)鏈接到目錄,則應(yīng)使用此選項(xiàng)。

了解硬鏈接與軟鏈接 (Understanding Hard vs Soft Links)

Hard Link

硬鏈接

A hard link directly points to the file, and acts to the operating system as if it is the file itself. You’ll want to use this option the majority of the time if you are trying to fake an application’s directory.

硬鏈接直接指向文件,并像文件本身一樣作用于操作系統(tǒng)。 如果要偽造應(yīng)用程序的目錄,則通常需要使用此選項(xiàng)。

Soft Link

軟鏈接

A soft link is essentially a shortcut to a file or folder – if you are using Windows explorer, you’ll be redirected to the directory if you double-click on a shortcut, it won’t pretend its part of the filesystem. You can still directly reference or open a file with the symlinked path, and it mostly works.

軟鏈接本質(zhì)上是指向文件或文件夾的快捷方式-如果您使用的是Windows資源管理器,則雙擊快捷方式將重定向到該目錄,它不會(huì)偽裝成文件系統(tǒng)的一部分。 您仍然可以直接使用符號(hào)鏈接的路徑引用或打開文件,并且該文件大多數(shù)都可以使用。

使用網(wǎng)絡(luò)共享中的符號(hào)鏈接 (Using Symlinks from a Network Share)

One of the things that’s been extensively discussed is that you cannot use the Vista symlinks from another operating system (not surprising), but you cannot use them from a network share either. This is troublesome if you expect to use this feature on a web server or a file server.

被廣泛討論的一件事是,您不能使用來自另一個(gè)操作系統(tǒng)的Vista符號(hào)鏈接(不足為奇),但是您也不能從網(wǎng)絡(luò)共享中使用它們。 如果您希望在Web服務(wù)器或文件服務(wù)器上使用此功能,則很麻煩。

刪除符號(hào)鏈接 (Deleting Symlinks)

To delete a symlink, you can just delete the link. Just make sure you don’t delete the original file.

要?jiǎng)h除符號(hào)鏈接,您只需刪除鏈接。 只要確保您不刪除原始文件即可。

翻譯自: https://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

總結(jié)

以上是生活随笔為你收集整理的在Windows Vista中使用符号链接的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。