my %stat; find ( sub { my($dev,$ino)= stat $File::Find::name; ++$stat{$dev}->{$ino}; }, $targetdirectory); #### find( { wanted => sub { : : # check whether or not we already know of this file my($dev,$ino)= stat $File::Find::name; return if $stat{$dev}->{$ino}++; : : }, no_chdir => 1, follow => 0, }, '/');