You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hard linked files shouldn't be counted as duplicates as they do not take up space on disk.
$ echo a > a
$ ln a b
$ cp a c
$ stat a b c | grep Inode
Device: 10302h/66306d Inode: 25463856 Links: 2
Device: 10302h/66306d Inode: 25463856 Links: 2
Device: 10302h/66306d Inode: 25463858 Links: 1
$ cargo run dup --directories ~/Development/czkawka/czkawka_cli -m1 -f /dev/stdout | grep -A99 "Files with"
-------------------------------------------------Files with same hashes-------------------------------------------------
Found 2 duplicated files which in 1 groups which takes 4 B.
---- Size 2 B (2) - 3 files
/home/thomas/Development/czkawka/czkawka_cli/a
/home/thomas/Development/czkawka/czkawka_cli/c
/home/thomas/Development/czkawka/czkawka_cli/b
$ rm c
$ cargo run dup --directories ~/Development/czkawka/czkawka_cli -m1 -f /dev/stdout | grep -A99 "Files with"
-------------------------------------------------Files with same hashes-------------------------------------------------
Found 1 duplicated files which in 1 groups which takes 2 B.
---- Size 2 B (2) - 2 files
/home/thomas/Development/czkawka/czkawka_cli/a
/home/thomas/Development/czkawka/czkawka_cli/b
It also looks like the duplicate disk space counting goes wrong in this case it should be 2. If you double count the hard link it should 3 not 4.
The text was updated successfully, but these errors were encountered:
Command ls or any file manager see hard links as normal files. Program can't check do it is hard link, for program it's regular file and this program can't check this too.
@TANDEXX, not exactly. ls command knows and shows when a file was hardlinked – indeed there are several ways to reach the file – by counting the reference number:
$ echo "hello" > file_1
$ ls -l file_1
-rw-r--r-- 1 user group 6 11 févr. 00:03 file_1
$ ln file_1 file_2
$ ls -l file_1 file 2
-rw-r--r-- 2 user group 6 11 févr. 00:03 file_1
-rw-r--r-- 2 user group 6 11 févr. 00:03 file_2
Hard linked files shouldn't be counted as duplicates as they do not take up space on disk.
It also looks like the duplicate disk space counting goes wrong in this case it should be 2. If you double count the hard link it should 3 not 4.
The text was updated successfully, but these errors were encountered: