1

How can I generate one text-file containing all sha1 hashes of all files on a dvd with many folders and subfolders?

1 Answer 1

2

Use find

find /path/to/DVD -exec sha1sum {} + > text.file
3
  • could you please explain the parameters being passed to sha1sum? i mean how does '{}' \; work
    – astrob0t
    Nov 9, 2014 at 1:30
  • 2
    Thank you Oli. astrob0t - -exec passes the file to a command, sha1sum, and the {} represent the file, + or \; continues to next file. the find command has a number of options and can seem complex, See content.hccfl.edu/pollock/Unix/FindCmd.htm for a great intro
    – Panther
    Nov 9, 2014 at 1:51
  • 1
    @astrob0t That's just how find substitutes the files it finds into commands. I've actually switched out {} \; for {} +. Instead of running sha1sum file1; sha1sum file2 ... it runs sha1sum file1 file2 .... Only works when the command can take multiple files like that but makes things faster.
    – Oli
    Nov 9, 2014 at 1:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .