How do I list the files in a directory that are hardlinks in windows

1

I'm trying to work with backups and new versions of backups and I want to check if files listed in a directory are already hardlink alias to some file or if they are the last link to that content.

The objective is to go to a directory, then ask which files are the only hard link and which files are not the only hard link without having to ask every single one individually.

To ask each one individually, I could use

fsutil hardlink list

But I would have to do that 1 by 1.

Any ideas on how to do that?

brunoais

Posted 2014-09-16T10:23:13.363

Reputation: 165

Answers

0

I made a cmd script that solves that issue.

Most help is in the comments
If you still need help, make a question issue in the gihub repo.

https://raw.githubusercontent.com/brunoais/cmd-dir-hardlinks/master/listHardLinks.bat

brunoais

Posted 2014-09-16T10:23:13.363

Reputation: 165

0

You can use finddupe.exe to list all files in a directory with the hardlink count. But apparently it's not compatible with non-ASCII characters in filenames and a port can be found here.

Find single Files:

finddupe.exe -v -listlink *.* | find /I "Hardlinked (1 links) node="

or files with multiple hardlinks:

finddupe.exe -v -listlink *.* | find /V /I "Hardlinked (1 links) node="


I was looking for such a solution several times in the last years but never stumbled upon your question. Thus:

How to list / display / show number / count of hardlinks of all files in a directory?

Limer

Posted 2014-09-16T10:23:13.363

Reputation: 63

I no longer use windows as my main OS, so I can't verity that. – brunoais – 2019-06-09T18:38:04.517