2019-02-27T22:13:36.7819247182019-03-04T21:52:31.122787645P4DT21H57M39S25LibreOffice/6.0.6.2$Linux_X86_64 LibreOffice_project/00m0$Build-22019-03-04T02:37:46.666605685 471 0 22287 10515 true false view2 8511 2536 0 471 22285 10984 0 1 false 250 false false false false false false false false true false true true false lwH+/1hlcm94X1BoYXNlcl82MTQwRE4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ1VQUzpYZXJveF9QaGFzZXJfNjE0MEROAAAAAAAAAAAWAAMAuAAAAAAAAAAEAAhSAAAEdAAASm9iRGF0YSAxCnByaW50ZXI9WGVyb3hfUGhhc2VyXzYxNDBETgpvcmllbnRhdGlvbj1Qb3J0cmFpdApjb3BpZXM9MQpjb2xsYXRlPWZhbHNlCm1hcmdpbmRhanVzdG1lbnQ9MCwwLDAsMApjb2xvcmRlcHRoPTI0CnBzbGV2ZWw9MApwZGZkZXZpY2U9MQpjb2xvcmRldmljZT0wClBQRENvbnRleERhdGEKUGFnZVNpemU6QTQAABIAQ09NUEFUX0RVUExFWF9NT0RFDwBEdXBsZXhNb2RlOjpPZmY= true false false true false true false 816919 false false true false false true true true true true true false false 1 false true false false false Xerox_Phaser_6140DN false false false false 0 false 0 true false false false false false true false false false true 1506730 true false false false high-resolution true true true false false false false false false false false false true false 0 true GNU Parallel Cheat Sheet GNU Parallel is a replacement for xargs, and for loops. It can also split a file or a stream into blocks and pass those to commands running in parallel. Examples Compress all *.html files in parallel – 2 per CPU threadparallel --jobs 200% gzip ::: *.html Convert all *.wav to *.mp3 using lameparallel lame {} -o {.}.mp3 ::: *.wav Chop bigfile into 1MB blocks and grep for the string foobarcat bigfile | parallel --pipe grep foobar Input sources parallel echo ::: cmd line input source cat input_from_stdin | parallel echo parallel echo ::: multiple input ::: source values parallel -a input_from_file echo parallel echo :::: input_from_file parallel echo :::: input_from_file ::: and command line Replacement string Value {} mydir/mysubdir/myfile.myext {.} mydir/mysubdir/myfile {/}, {//}, {/.} myfile.myext, mydir/mysubdir, myfile {#} The sequence number of the job {%} The job slot number {2} Value from the second input source {2.} {2/} {2//} {2/.} Combination of {2} and {.} {/} {//} {/.} {= perl expression =} Change $_ with perl expression Control the output – keep the order the same as the input parallel --keep-order "sleep {}; echo {}" ::: 5 4 3 2 1 Control the execution Run 2 jobs in parallel parallel --jobs 2 "sleep {}; echo {}" ::: 5 4 3 2 1 See what will be run parallel --dryrun echo ::: Red Green Blue ::: S M L Remote execution parallel -S server1 -S server2 "hostname; echo {}" ::: foo bar Pipe mode cat bigfile | parallel --pipe wc -l Chop bigfile into one block per CPU thread and grep for foobarparallel -a bigfile --pipepart --block -1 grep foobar Read more – Your command line will love you for it parallel --help; man parallel; man parallel_tutorial GNU Parallel 2018 https://doi.org/10.5281/zenodo.1146014