Saturday, February 11, 2012

md5sum

find ! -type d | xargs md5sum
find $@ ! -type d -print0 | xargs -0 md5sum  <--------- 위와 동일

# find ! -type d | xargs md5sum | head
1817f4e8f54ed24302006935cea63652  ./test3.php
eef055589b85482f382202d6998737a9  ./test.png
1817f4e8f54ed24302006935cea63652  ./test.php
9dccf462d245f55ac3e0cdb0e5401f5b  ./info.php
21dde95d9d269cbb2fa6560309dca40c  ./index.html
1817f4e8f54ed24302006935cea63652  ./test2.php

# find $@ ! -type d -print0 | xargs -0 md5sum | head
1817f4e8f54ed24302006935cea63652  ./test3.php
eef055589b85482f382202d6998737a9  ./test.png
1817f4e8f54ed24302006935cea63652  ./test.php
9dccf462d245f55ac3e0cdb0e5401f5b  ./info.php
21dde95d9d269cbb2fa6560309dca40c  ./index.html
1817f4e8f54ed24302006935cea63652  ./test2.php

----------- NOTE -----------

-print    : print  the  full file name on the standard output, followed by a newline.
-print0 : print the full file name on the standard output, followed by a null character (instead of the newline  character that -print uses).


-0    : Input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every charac‐ter is taken literally).