Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using this right now:

time md5sum -c *.txt | pv | grep -v ': OK$'

but aren't there any smart solutions that can list that how many files haven't been checked? I mean I have many md5sum's in .txt files in a dir, and I need to check them, but it would be a good thing to know that how much files are left to scan..

p.s.: so it's not really a progress bar, just a counter that output how many files are there left to "md5sum -c FILENAME"..

share|improve this question
up vote 2 down vote accepted

You could pass the names to md5sum one by one.

n=$(cat *.txt | wc -l)
cat *.txt | {
  i=0 bad=0
  while IFS= read -r line; do
    echo "Checking file $i/$n: $line"
    echo "$line" | md5sum -c - || bad=$((bad+1))
  [ $bad -eq 0 ] || { echo "$bad bad checksums"; false; }

Or, for casual use, you can run the simple command and check which file md5sum is up to by seeing what it has open.

lsof -p1234
# note the file name
cat *.txt | grep -n FILENAME
share|improve this answer
thanks, it's almost perfect :P i upgraded/downgraded it a little bit: pastebin.com/raw.php?i=eqfiXzaB – LanceBaynes Jul 17 '11 at 14:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.