Skip to content

Instantly share code, notes, and snippets.

@gzfrancisco
Last active August 29, 2015 14:01
Show Gist options
  • Save gzfrancisco/127d9f6010e74a025448 to your computer and use it in GitHub Desktop.
Save gzfrancisco/127d9f6010e74a025448 to your computer and use it in GitHub Desktop.

Revisions

  1. gzfrancisco renamed this gist May 20, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. gzfrancisco revised this gist May 20, 2015. 2 changed files with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Hash a entire folder.md → README.md
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,4 @@ MIT

    Francisco Granados
    [gzfrancisco.name](http://gzfrancisco.name)
    [@gzfrancisco](http://twitter.com/gzfrancisco)
    [@gzfrancisco](http://twitter.com/gzfrancisco)
    File renamed without changes.
  3. gzfrancisco renamed this gist May 21, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. gzfrancisco revised this gist May 21, 2014. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # Hash a entire folder

    Script in bash which obtains get hash values of entire folders.

    ## ToDo's

    * Man page
    * Usage
    * Take the arguments for:
    * Folder to hash
    * File where save the hash value
    * Remove temporaly files at the end

    ## License

    MIT

    ## Author

    Francisco Granados
    [gzfrancisco.name](http://gzfrancisco.name)
    [@gzfrancisco](http://twitter.com/gzfrancisco)
  5. gzfrancisco created this gist May 21, 2014.
    9 changes: 9 additions & 0 deletions hash_entire_folder
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #! /usr/bin/env bash

    find ./folder -type f > ./files_only.txt

    IFS=$'\n' read -d '' -r -a lines < ./files_only.txt

    for (( i=0; i < ${#lines[@]}; i++))
    do openssl sha -sha384 "${lines[$i]}" >> hash_files_only.txt
    done