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.

2
  • Your third example produces valid output for me. What operating system are you testing on? Commented Mar 9, 2012 at 15:20
  • Ubuntu 10.04.4 LTS + bash version 4.1.5(1)-release (x86_64-pc-linux-gnu) Commented Mar 9, 2012 at 15:28

1 Answer 1

3

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

$ find . -type f -print0 | xargs -0 md5sum | sort
1
  • Ah, yes indeed. Should have noticed that. Thanks. :) Commented Mar 9, 2012 at 16:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.