1

I just created a hardlink in Windows 7 using mklink. When I use dir the output doesn't indicate that the new hardlink is a hardlink. Instead it looks exactly like the file it is pointing to.

Example output from dir:

05/16/2013  12:07 AM            40,448 HardlinkToOriginal
05/16/2013  12:07 AM            40,448 OriginalFile

On Windows 7 how do you check to see if a file is a hardlink?

I know that you can do: fsutil.exe hardlink list OriginalFile and this will tell you that HardlinkToOriginal is a hardlink, but you need a-priori knowledge that is not available. Ideally I would like something like ls -al on Linux where if the file is a link then the command tells you it is a link and shows you where it points to.

  • 3
    I know that you can do: fsutil.exe hardlink list OriginalFile and this will tell you that HardlinkToOriginal is a hardlink, but you need a-priori knowledge that is not available. Ideally I would like something like ls -al on Linux where if the file is a link then the command tells you it is a link and shows you where it points to. – Trevor Boyd Smith Aug 13 '13 at 14:04
  • I guess this is what you are looking for: superuser.com/questions/366739/… find . -links +1. Additionally I want to mention the tool ls.exe which provides the same as ls on linux – nixda Aug 13 '13 at 14:18
  • 1
    Are you sure that ls -al "shows you where it points to" for hard links? (Surely, it does so for symbolic links aka softlinks.) – Arjan Aug 13 '13 at 14:32
  • 2
    @Arjan you are correct. On linux ls -al does not show hardlinks. You have to use the solution from the superuser question here. – Trevor Boyd Smith Aug 13 '13 at 14:46
-1

I don't believe you can. In fact, if you delete OriginalFile, you'll still have HardlinkToOriginal available.

  • 3
    That is the entire point of using hard links rather than soft links. :) – Hennes Aug 13 '13 at 14:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.