I have a deep directory structure, with a large number of files (about 1M). I'd like to execute a command against each. (In my case the files are pngs which I'd like to run optipng against.)
I've tried this:
find . -name *.png | xargs sudo optipng -o2
but am getting the error
argument list too long.
I'm assuming that xargs should be able to handle this, and that there must be a problem with my syntax.