Show Menu

GNU Parallel Cheat Sheet by

Quick Example Commands From Manual
gnu     linux     find     gnu-parallel     parallel     gnuparallel     xargs

Overview

GNU parallel is a shell tool for executing jobs in parallel using one or more comput­ers.
It's a great replac­ement for xargs or find and can do amazing things.

http:/­/ww­w.g­nu.o­rg­/so­ftw­are­/pa­ral­lel­/pa­ral­lel­_tu­tor­ial.html
http:/­/ww­w.g­nu.o­rg­/so­ftw­are­/pa­ral­lel­/ma­n.html

This is just a sheet of quick example commands and a concise reference.

Example Commands

Compress all *.html files in parallel
  pa­rallel gzip --best ::: *.html
Convert (via lame) all *.wav files to *.mp3
  pa­rallel lame {} -o {.}.mp3 ::: *.wav
Delete pict{0..9­999­}.jpg files in parallel
  seq -w 0 9999 | parallel rm pict{}.jp­g    # Runs rm 10,000 Times
  seq -w 0 9999 | parallel -X rm pict{}.jp­g # Runs rm minimal times
 

Command Synopsis

para­llel [options] [command [argum­ents]] < list_o­f_a­rgu­ments
para­llel [options] [command [argum­ents]] ( ::: arguments | :::: argfile(s) ) ...
para­llel --sema­phore [options] command
#!/u­sr/­bin­/pa­ral­lel --shebang [options] [command [argum­ents]]

Input Lines

{}
Unaltered input line (foo/b­ar.jpg)
{.}
Remove extension: foo/bar
{/}
Basename: bar.jpg
{//}
Dirname: foo/
{/.}
Basename w/o ext: bar
{#}
Sequence Number of Job
{%}
Job Slot Number
{n}
Argument from input source n or the n'th argument.
{n.}
Combo of {n} and{.}.
{n/}, {n//}, {n/.}
Other Combo's Available
{=perl expres­sion=}
$_ with = {}, $_ is output after eval.

Download the GNU Parallel Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/cpriest_gnu-parallel.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          find Cheat Sheet