hashdeep icon indicating copy to clipboard operation
hashdeep copied to clipboard

Spacing inconsistent with hashdeep and md5deep (makes sorting difficult)

Open newhoa opened this issue 8 years ago • 3 comments

Output spacing is inconsistent between hashdeep and md5deep making sorting difficult when using hashdeep.

Using md5deep -z, the output list is nicely spaced where the byte size is grouped in a column, the hash has its own column, and the location is grouped in its own column.

This makes sorting easy by piping it to sort because the hash and locations begin on the same column in each row.

Hashdeep does not do this. It seems to output size,hash,location all grouped with just a comma in between. This makes sorting very difficult because you can't tell sort to sort by a specific columns since each location and hash begin on a different column.

Is there a solution to this I'm missing? If not is there any way to add an option to hashdeep to space like md5deep?

Thanks!

newhoa avatar Feb 11 '18 00:02 newhoa

I am not quite sure I understood your dilemma completely, but the 'sort' command does allow sorting specific columns.

http://www.folkstalk.com/2012/08/sort-command-examples-in-unix-linux.html With the examples from the previous link, I am able to sort my hashdeep.txt by filename location (third column). command: sort -t',' -k 3 -d < hashdeep.txt > hashdeep.txt.sorted

version2013 avatar Feb 11 '18 02:02 version2013

Hey thanks for the response. That sort command was helpful, it did help sort by filename location properly! Thank you! (Although it also changed the order of the hashdeep header, not a big deal). I should've been able to figure that out.

The spacing inconsistency is still there in the output, though. md5deep displays much cleaner. It makes it easier to read, edit in an editor and via cli, and to sort (only needs 'sort -k1.46' for the 46th column, columns are consistent).

md5deep outputs this:

    1311288  b742e18de0930c91afcb75ec2296a8a6  /home/user/partest/bk.vol031+32.par2
      41632  2d4a4a3a32fff1ad134f1b07ceee3824  /home/user/partest/bk.par2
     162937  5448baa731ceb08c481235c829912d6a  /home/user/partest/New Folder/8422.Figure%2021%20-%20Real%20Estate%20comparison_2.png
   63155157  8abfbf251d645522aea05ee6e1f55ea7  /home/user/partest/mkaaudio.mka

hashdeep outputs this:

1311288,b742e18de0930c91afcb75ec2296a8a6,/home/user/partest/bk.vol031+32.par2
41632,2d4a4a3a32fff1ad134f1b07ceee3824,/home/user/partest/bk.par2
162937,5448baa731ceb08c481235c829912d6a,/home/user/partest/New Folder/8422.Figure%2021%20-%20Real%20Estate%20comparison_2.png
63155157,8abfbf251d645522aea05ee6e1f55ea7,/home/user/partest/mkaaudio.mka

For me, the way md5deep does it makes manipulation of the file much easier because what appears down the file is consistently on the same column. It would be nice for the option at least to exist in hashdeep to display in the same way.

newhoa avatar Feb 11 '18 07:02 newhoa

md5deep -c sha512 -lr . produces unexpected output:

558709bc80b3f39df59e67d343ebf533,./.config/syncthing/index-v0.14.0.db/007381.ldb

HaleTom avatar Sep 17 '19 07:09 HaleTom