GNU Parallel "HongKong" released

From LinuxReviews
Jump to navigationJump to search
Gnu-head.jpg

The GNU Project has released a new version of the handy command-line tool GNU Parallel code-named HongKong. The latest version of this 10 year old tool which lets you easily run a series of single-threaded commands in parallel on a multi-core system can accept a perl expression as an argument to it's --shard parameter.

There's also bug-fixes and updates to GNU Parallel's already really long manual page. What code-name "HongKong" means is unclear. The last version released a month ago was code-named Akihito.

Gnu.jpg

If you are unfamiliar with Parallel: It's a simple tool which lets you easily run multiple jobs instead of one at a time. It takes the same argument as xargs. As a simple example, if you would like to make a bunch of png files in a folder smaller with pngquant you could run

Shell command(s):
f in *.png;do pngquant ${f};done

and have one file at a time be processed OR you could run

Shell command(s):
parallel -j6 pngquant ::: *.png

and have 6 pngquant jobs run in parallel until all the images are processed.

Basic use is pretty strait forward but the more advanced use-cases - and there are a lot of possibilities laid out in the really long manual page - require some reading. The programs author Ole Tange has written a book which can be read on-line at https://zenodo.org/record/1146014 and a paper-back book is on sale as of right now at Lulu.com

GNU Parallel is available in all the distributions repositories. Updated packages for all the distributions as well as *BSD's can be acquired from https://www.gnu.org/software/parallel/ if you really want the latest. The version in your distributions repositories is probably fine unless you really want to pass a perl expression on to --shard.