Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used comm to compare two sorted files. Each line in these files are positive integer numbers. But the results show

comm: file 1 is not in sorted order
comm: file 2 is not in sorted order

How come the error even if these two files are sorted?

share|improve this question

comm wants lexicographic sort, not numeric sort. Correct this and the problem should go away.

share|improve this answer
how to make it do numeric sort? – wenzi Nov 16 '12 at 11:32
@wenzi sort -n – Gilles Nov 16 '12 at 22:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.