Show Menu

GNU Parallel Cheat Sheet by

Quick Example Commands From Manual


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.


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
Argument from input source n or the n'th argument.
Combo of {n} and{.}.
{n/}, {n//}, {n/.}
Other Combo's Available
{=perl expres­sion=}
$_ with = {}, $_ is output after eval.

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi


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