[Discuss] GNU xargs trick

Mike Small smallm at sdf.org
Wed Apr 27 12:31:49 EDT 2016


Daniel Barrett <dbarrett at blazemonger.com> writes:

> 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:

New line characters in particular. -I changes matters to line at a time
so other space characters should be okay, right?

-- 
Mike Small
smallm at sdf.org



More information about the Discuss mailing list