I'd like to retrieve the total file size of all images that fullfill a certain critera (recursively whithin a directory)
For example if I execute the following bash command
find ~/SomeDirectory -type f -name '*.JPG' -exec du -ch {} + | grep total$
I get the total file size of all files with the extension JPG (nicely human readable like e.g. "50.2G total")
Now I would like to get the same result but using exiftool "if expressions" like
exiftool -r -T -if '$FileType eq "JPEG" ~/SomeDirectory -FilePath
Of course, this only lists me all the FilePaths. So how would I get the total file size for all these files, like above?
Working solutions are appreciated, thank you in advance!
This should do it:
exiftool -r -if '$FileType eq "JPEG"' ~/SomeDirectory -filesize# -s3 -q | awk '{ total+=$1 }; END { printf "%.0f\n", total }'
- Phil
What an awsome response time, thank you very much, thats exactly it! Love your tool. Cheers!