rust-parallel

Command-line utility to execute commands in parallel and aggregate their output.

Similar interface to GNU Parallel or xargs but implemented in rust and tokio. * Supports running commands read from stdin or input files similar to xargs, for example: * head -1000 /usr/share/dict/words | rust-parallel md5 -s * Supports ::: syntax to run all combinations of argument groups similar to GNU Parallel, for example: * rust-parallel gzip -k ::: *.html

Prevents output interleaving and is very fast.

See the demos for example usage.

Crates.io CI workflow

Contents:

Usage:

``` $ rust-parallel --help Execute commands in parallel

By Aaron Riekenberg aaron.riekenberg@gmail.com

https://github.com/aaronriekenberg/rust-parallel https://crates.io/crates/rust-parallel

Usage: rust-parallel [OPTIONS] [COMMANDANDINITIAL_ARGUMENTS]...

Arguments: [COMMANDANDINITIAL_ARGUMENTS]... Optional command and initial arguments.

      If this contains 1 or more ::: delimiters the cartesian product of arguments from all groups are run.

Options: -d, --discard-output Discard output for commands

      Possible values:
      - stdout: Redirect stdout for commands to /dev/null
      - stderr: Redirect stderr for commands to /dev/null
      - all:    Redirect stdout and stderr for commands to /dev/null

-i, --input-file Input file or - for stdin. Defaults to stdin if no inputs are specified

-j, --jobs Maximum number of commands to run in parallel, defauts to num cpus

      [default: 8]

-0, --null-separator Use null separator for reading input files instead of newline

-s, --shell Use shell mode for running commands.

      Each command line is passed to "<shell-path> -c" as a single argument.

-t, --timeout-seconds Timeout seconds for running commands

  --channel-capacity <CHANNEL_CAPACITY>
      Input and output channel capacity, defaults to num cpus * 2

      [default: 16]

  --disable-path-cache
      Disable command path cache

  --shell-path <SHELL_PATH>
      Path to shell to use for shell mode

      [default: /bin/bash]

-h, --help Print help (see a summary with '-h')

-V, --version Print version ```

Installation:

Recommended:

  1. Download a pre-built release from Github Releases for Linux or MacOS.
  2. Extract the executable and put somewhere in your $PATH.

For manual installation/update: 1. Install Rust 2. Install the latest version of this app from crates.io: $ cargo install rust-parallel 3. The same cargo install rust-parallel command will also update to the latest version after initial installation.

Demos:

See the wiki page for demos.

Benchmarks:

See the wiki page for benchmarks.

Features:

Tech Stack: