my %stat; find ( sub { my($dev,$ino)= stat $File::Find::name; ++$stat{$dev}->{$ino}; }, $targetdirectory);