Bash Parallel

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Jobs in GNU Linux can be parallelized using GNU parallel. A job can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe.

Syntax

  1. parallel [options] [command [arguments]] < list_of_arguments >

Parameters

OptionDescription
-j nRun n jobs in parallel
-kKeep same order
-XMultiple arguments with context replace
--colsep regexpSplit input on regexp for positional replacements
{} {.} {/} {/.} {#}Replacement strings
{3} {3.} {3/} {3/.}Positional replacement strings
-S sshloginExample: [email protected]
--trc {}.barShorthand for --transfer --return {}.bar --cleanup
--onallRun the given command with argument on all sshlogins
--nonallRun the given command with no arguments on all sshlogins
--pipeSplit stdin (standard input) to multiple jobs.
--recend strRecord end separator for --pipe.
--recstart strRecord start separator for --pipe.


Got any Bash Question?