如何在Windows中查看文件的硬链接?

我已经find了Windows 中硬链接和连接的描述 ,但是我想从Windows UI或命令提示符中知道如何查看特定文件或文件夹的硬链接?

包含在Windows XP及更高版本中的fsutil实用程序 。 例:

 fsutil.exe hardlink list C:\Windows\System32\notepad.exe 

示例结果(来自Windows 7):

 \Windows\System32\notepad.exe \Windows\notepad.exe \Windows\winsxs\amd64_microsoft-windows-notepadwin_31bf3856ad364e35_6.1.7600.16385_none_9ebebe8614be1470\notepad.exe \Windows\winsxs\amd64_microsoft-windows-notepad_31bf3856ad364e35_6.1.7600.16385_none_cb0f7f2289b0c21a\notepad.exe 

fsutil需要提升系统权限。 如果你只是需要阅读,而不是创build链接,这是非常不方便的。

微软还发布免费的链接 ,这是更友好的语法,提供额外的细节,并不需要特殊的权限。

从John K post那里判断自己是同一个文件,用findlinks分析findlinks

 findlinks c:\windows\notepad.exe FindLinks v1.0 - Locate file hard links Copyright (C) 2011 Mark Russinovich Sysinternals - www.sysinternals.com c:\windows\notepad.exe Index: 0x000037A6 Links: 3 Linking files: c:\Windows\System32\notepad.exe c:\Windows\winsxs\amd64_microsoft-windows-notepadwin_31bf3856ad364e35_6.1.7600.16385_none_9ebebe8614 be1470\notepad.exe c:\Windows\winsxs\amd64_microsoft-windows-notepad_31bf3856ad364e35_6.1.7600.16385_none_cb0f7f2289b0c 21a\notepad.exe 

::

不是直接你需要什么,但巧妙地使用这个目标可能仍然有用:
FINDDUPE是一个在http://www.sentex.net/~mwandel/finddupe/地址上托pipe的独立命令行工具,具有侧面function,允许通过以下调用recursion列出目录内的所有硬链接:
finddupe -listlink <directory_of_interest>

下面是一个输出结果的例子:

 Hardlink group, 2 of 2 hardlinked instances found in search tree: ".\1" ".\_1" Number of hardlink groups found: 1 

注意:SourceForge上有许多类似名称的项目,但目前没有任何东西托pipe上述实用程序。

Sysinternals的FindLinks工具应该正是你所需要的。

 findlinks C:\Windows\notepad.exe 

尝试该程序NTFSLinksView – 在Windows 10上正常工作,应该在Vista和更高版本上工作。

Hermann Schinagl的ln CLI实用程序应该可以工作:

 ln --list 

还有一个shell扩展 。