1

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"..

2

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
    i=$((i+1))
    echo "Checking file $i/$n: $line"
    echo "$line" | md5sum -c - || bad=$((bad+1))
  done
  [ $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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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