How to list files which have same size?

Hi guys,

I need to do 100 files comparison after I sorted the files. There are no specific key for sorting so i plan to arrange the files based on the file size. The command that i used to sort the files by size is as per below:-

ls -l | sort +4rn | awk '{print $5, $9}'

The problem that i face right now is, there are 2 files which have same size. So when i do comparison these 2 files are not match with each other. What I mean is, when i do the file comparison, the 000675 should compare with 000457 but it compare with 000470.

Example:-

dir A:-

1534     XXX_000675.20101122135836.XX
1534     XXX_000679.20101122135842.XX

dir B:-

1534    XXX_000457.20101122080310.XX
1534    XXX_000470.20101122080310.XX

So how i want to sort the file by file size which also have 2 files with the same size.
Do guys have idea on this?

Appreciate your respond

What does the highlighted syntax do? It's not valid on my system.

It is ancient syntax: +position. +4rn means sort reverse numeric starting character pos 4.

I do not see what it actually does either, since the 4th position in the examples == 4.

Might also be of interest :

man cksum
man bart
man digest