Creating an MD5 file for a directory tree for only a given extension

Posted on

Creating an MD5 file for a directory tree for only a given extension – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about windows, command-line-interface, find, filter, md5.

I would like to create an MD5 file of a directory tree, containing only the bare names of the files. md5deep exactly does that, but it cannot filter for files when in recursive mode.

md5deep -rb . > md5.txt

Is there any way to filter for (*.jpg) before outputting it to md5.txt? In Linux it would be just a |, but how do I do it in Windows?

Solution :

md5deep doesn’t filter just those file you give in the filspec e.g. *.jpg. You can use find to generare the file list and pass it to md5deep

find . -name '*.jpg' -exec md5deep -b {} + >>md5.txt

You should delete the md5.txt file before running the code again otherwise it will have a new set of files appended to it.

Leave a Reply

Your email address will not be published. Required fields are marked *