Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show hash of files in a directory

Tags:

powershell

What is the easiest way to list all files in a directory with their hashes?

I am trying to compare a list of files in a folder. The problem is that all the file sizes are the same but I need to ensure that their content are the same too.

like image 245
Jacques Snyman Avatar asked Jul 19 '18 12:07

Jacques Snyman


1 Answers

Powershell has a cmdlet named Get-FileHash. One can just do a ls and pipe the output to GetFileHash

eg. ls | Get-FileHash

You can also specify the hash algorithm by passing the -Algorithm parameter:

eg. ls | Get-FileHash -Algorithm MD5

like image 166
Jacques Snyman Avatar answered Oct 16 '22 21:10

Jacques Snyman