[Discuss] GNU xargs trick

Daniel Barrett dbarrett at blazemonger.com
Wed Apr 27 12:18:19 EDT 2016


On April 27, 2016, Rich Pieri wrote:
>find . -name "*.png" -print | xargs -I{} -P 4 optipng -o1 -preserve {}

Nice trick. I'd recommend using "find -print0" and "xargs -0" for
safety, in case any of your PNG filenames contain space characters:

  find . -name "*.png" -print0 | xargs -0 -I{} -P 4 optipng -o1 -preserve {}

--
Dan Barrett
dbarrett at blazemonger.com



More information about the Discuss mailing list