talira

GNU Parallel

A shell tool for executing jobs in parallel using one or more computers

open sourceGPL-3.0-or-laterself-hostablefree

GNU Parallel is a shell tool for running jobs in parallel on the local machine or on remote computers. A job is usually a command or small script run once for each line of input, such as a list of files, hosts, users, URLs or tables, and Parallel can also split piped input across commands. It takes the same options as xargs, can replace most shell loops, and makes sure the output is the same as if the commands had run one after another. It comes with related tools (env_parallel, sem, parcat, parset, parsort, sql and niceload), extensive documentation and a book.

Ways to install

Package managers

Problems it solves

  • my for loop over thousands of files runs one at a time and leaves most CPU cores idle
  • run a command on every line of a file using all cores, like xargs but smarter
  • spread a batch of jobs across several servers over SSH
  • run jobs in parallel but keep their output in order and not interleaved
  • split a huge piped input into chunks and process them concurrently
  • limit how many jobs run at once in a shell script, like a semaphore
  • sort a very large file faster using all my CPU cores

Features

  • same options as xargs
  • runs jobs locally or on remote computers
  • output grouped so it matches sequential runs
  • splits piped input into blocks for parallel commands
  • env_parallel copies shell functions and variables to jobs
  • sem: counting semaphore for shell scripts
  • parcat, parset and parsort
  • GNU sql and GNU niceload
  • tutorial, how-to examples, reference man pages and design notes
  • safety features such as no silent data loss if the disk fills mid-job

Capabilities

Has a command line toolplan not known