On 04/09/2014 11:03 PM, Jonathan Dowland wrote:
On Wed, Apr 09, 2014 at 03:12:40PM +0200, Alex Mestiashvili wrote:
|
  find . -name "*.png" | parallel -P8 convert -quality 95 {} -geometry 1280 
/tmp/{.}.jpg|
Alternatively

find . -name "*.png" -exec convert -quality 95 {} -geometry 1280 /tmp/{}.jpg +

note '+' not '\;' which denotes to run jobs in parallel (here, not specifying
a max concurrency limit)



Nice, thanks for sharing!  but according the man page
 "Only one instance of `{}' is allowed within the command"

The benefit of parallel over xargs or find is that it is much more flexible with arguments in {}.
For example in the first convert example png files are converted to jpg.
With xargs the result will look like $file.png.jpg
With parallel one can alter arguments in {}, so the end result will be $file.jpg

Best,
Alex





--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/534650b0.4010...@biotec.tu-dresden.de

Reply via email to