1

This works:

find . -type f | xargs md5sum | sort

This does not and gives several "md5sum: xyz not found" errors:

( find . -type f | xargs md5sum | sort ) >~/md5.txt

Same for:

find . -type f | xargs md5sum | sort >~/md5.txt

This works:

md5deep -r . | sort >~/md5.txt

I would like to understand why the redirection of the pipe constructs doesn't work.

  • Your third example produces valid output for me. What operating system are you testing on? – Der Hochstapler Mar 9 '12 at 15:20
  • Ubuntu 10.04.4 LTS + bash version 4.1.5(1)-release (x86_64-pc-linux-gnu) – KIAaze Mar 9 '12 at 15:28
3

Very possibly, file name starts with xyz contains white space.
You can try this:

$ find . -type f -print0 | xargs -0 md5sum | sort
| improve this answer | |
  • Ah, yes indeed. Should have noticed that. Thanks. :) – KIAaze Mar 9 '12 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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