1

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

Oli
  • 293,335

1 Answers1

2

Use find

find /path/to/DVD -exec sha1sum {} + > text.file
Oli
  • 293,335
Panther
  • 102,067
  • could you please explain the parameters being passed to sha1sum? i mean how does '{}' \; work – astrob0t Nov 09 '14 at 01: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 http://content.hccfl.edu/pollock/Unix/FindCmd.htm for a great intro – Panther Nov 09 '14 at 01: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 09 '14 at 01:52