# algorithm for comparing files

**URL:** <https://community.unix.com/t/algorithm-for-comparing-files/217504>\
**Category:** Shell Programming and Scripting\
**Created:** [October 22, 2008, 5:31am UTC](https://community.unix.com/t/algorithm-for-comparing-files/217504 "2008-10-22T05:31:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satyak](https://community.unix.com/letter_avatar/satyak/32/6_449c533f586939b6e5f246632a46421f.png) [@Satyak](https://community.unix.com/u/Satyak)\
**Post date:** [October 22, 2008, 5:31am UTC](https://community.unix.com/t/algorithm-for-comparing-files/217504/1 "2008-10-22T05:31:34Z")

</div>

hi  
i have 1000 files, i need to compare files with one another,  
can some help with logic with to decrease the no of comparings

thanks  
Satya

---

<div class="post-metadata">

**Author:** ![Tytalus](https://community.unix.com/user_avatar/community.unix.com/tytalus/32/87_2.png) [@Tytalus](https://community.unix.com/u/Tytalus)\
**Post date:** [October 22, 2008, 6:36am UTC](https://community.unix.com/t/algorithm-for-comparing-files/217504/2 "2008-10-22T06:36:19Z")

</div>

what sort of comparison are you after.

do yo need to verify contents of files or sizes, or some other form of compare ?

what sort of size/content are your files ?

do you need to compare every file against every other file, or is there some sort of sequence ?
