du prints out the size of files. Using the -m flag (if supported) gives file size in MB. The -c flag gives you the total size of all file.
find finds files. you could "find . -name '*.jpg' -or -name '*.jpeg' " to find all your jpg/jpeg files (in the current directory or below). This thing has lots of options so it can find damned near anything you want to specify.
The ` (back-tick) operator takes the output of a previous command and makes it the command-line for another.
Stringing this together, you get :
Code:
du -mc `find . -name '*.jpg' -or '*.jpeg'`
which will list all jpeg files & then their total size. If you just want the total, you can add a "| tail -1" to pipe (route) the output of that command through tail, which will only show the last line of its input.
Unix commands are like Legos, there's only a few of them but you can connect them in all sorts of crazy ways to make different things.