GNU Parallel Parallel shell jobs
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
parallel <cmd> {} ::: <a> <b>
ls | parallel <cmd> {}
parallel --dry-run <cmd> {} ::: <a>
parallel -j 4 ...
parallel -k ...parallel --bar ...
parallel --joblog <file> ...
parallel {.} {/} {#}
Concepts
- Input ::: / :::: / stdin
- Arguments one per job
- Job slots -j N at a time
- Output per job, in order with -k
Inputs
parallel <cmd> ::: <a> <b>
<c>
<producer> | parallel <cmd>
parallel <cmd> :::: <file>
parallel -0 <cmd>
parallel -d <delim> <cmd>
parallel <cmd> ::: <a> <b> ::: <x>
<y>
parallel <cmd> ::: <a> <b> :::+
<x> <y>
Replacement strings
{}{.}{/}{/.}{#}{%}{1} {2} {-1}Running jobs
parallel -j <N> ...
parallel -n <N> ...
parallel -X ...Safety and preview
parallel --dry-run <cmd> ::: <a>
<b>
parallel --halt now,fail=1 ...
parallel -q <cmd> '<arg with $>'
Output and progress
parallel -k ...parallel --bar ...
parallel --tag ...
Joblog and resume
parallel --joblog <file> ...
parallel --joblog <file> --resume ...
parallel --joblog <file> --resume-failed ...
Splitting stdin
<producer> | parallel --pipe <cmd>
parallel --pipe -N <N> <cmd>
Remote hosts
parallel -S <host1>,<host2> ...
parallel --transferfile {} -S <host> ...
Recipes
ls *.png | parallel convert {} {.}.jpg# or safe for odd names:find . -name '*.png' -print0 | parallel -0 convert {} {.}.jpg
parallel --dry-run gzip {} ::: *.logparallel -j 4 --bar --joblog jobs.log gzip {} ::: *.log# interrupted? pick up where it stopped:parallel -j 4 --joblog jobs.log --resume gzip {} ::: *.log
parallel --tag -k ./run.sh --lr {1} --bs {2} \ ::: 0.1 0.01 ::: 32 64
cat big.txt | parallel --pipe --block 20M -k \ grep -c '<pattern>' | paste -sd+ | bc



