Find size of a path excluding hardlinks on Big Sur
I use a backup program which creates hard links of files with each backup. For example, if I back up a source directory that is 100 MB in size three times without changing anything, the program will simply hard link the files such that only 100 MB of disk space is used overall.
In the Finder, trying to find the size of the overall folder will display 300 MB because Finder is unable to determine how files are related to each other using hard links. Is there any way to see the actual size of the directory containing the backups, i.e. the size of the inodes that make up the files inside the directory?
I found a similar question about finding the actual size of Time Machine backups, but the solution does not seem to work on Big Sur.
Tested this and can confirm in Finder it will show the total disk used by all of the hard links.
To find out the 'real' disk usage, use a terminal and use the command
du -hs
or
du -s