I wanted to find the number of image files within a directory. I ended up using this :
find . -type f -exec file {} \; | grep -c -i 'image'
This feels like an inefficient way of doing it. I could think of another way to do it - using an OR statement, but I couldn't figure out from the man page how this could be done.
Any ideas how this could be done more efficiently? I don't want to execute the commands above on a directory with a rather large number of files and have it take forever.