find multiple identical files?

find multiple identical files?

Post by Andreas Ho » Fri, 09 Dec 1994 00:14:27



Does anyone know if there are programs which find all multiple identical
files in a whole UNIX filesystem?. It would be ideal if it would return
the paths/filenames of all files which exist more than once...

Tank you,  
  Andreas

--

Leo-Weismantel-str.1/A1403, 97074 Wuerzburg, FRG.     phone: +49-931-884056

 
 
 

find multiple identical files?

Post by Martin Gemm » Sat, 10 Dec 1994 02:46:12



} Does anyone know if there are programs which find all multiple identical
} files in a whole UNIX filesystem?. It would be ideal if it would return
} the paths/filenames of all files which exist more than once...

If identical means having the same inode, then you can get away with
something like

        find / -type f \( \! -links 1 \) -print

If not, then use the following script. I hope you're sure about it.

Martin
---------------------------------------------------------------------------
#!/usr/bin/perl



        while($f2 = $f[$i]) {
                open(F, $f2); sysread(F, $b, (stat $f2)[7]); close F;
                if ($a eq $b) {

                        push(i, $f2)
                } else { $i++ }
        }

Quote:} continue { reset 'i' }


 
 
 

1. Identical lines in multiple (large) files, how to find?

How do I identify identical lines in multiple large files?
My diff(1) has no manpage, and I didn't see an option to do it.
Grep didn't seem to help either.

This is probably a FAQ.  However, it is not in "the FAQ".

Sorry about my earlier question, I didn't notice it was in the FAQ:
      4.4)  How can an executing program determine its own pathname?

Oh well, live and learn :-)
--
Protect our endangered bandwidth - reply by email.  NO BIG SIGS!

2. Intel Etherexpress net card problems

3. removing multiple identical lines from a file

4. Large-Integer Arithmetic

5. find identical files

6. Mesa faster then X-Inside OpenGL? Part 2

7. Finding identical files

8. IT press waking up to their bad predictions...

9. Finding files that are identical (in Unix)

10. Finding multiple files with 'find'

11. Handling of multiple identical servers by the portmapper

12. Multiple identical routes?