cat numbers.txt
) and passing them to parallel using a |
symbol. Then we need to tell parallel to do something with the values it receives. You can can see we have replace the x values with the symbols {}
. This is a kind of place holder value which parallel will replace for each line with the value of the line. Finally the -j 1
flag tells parallel to run 1 job at a time. Here is a schematic of what parallel is doing-j
to 2 here, but if you are running on a machine with a high number of threads you can run more commands together by increasing the value. Just remember the your job might already be using multiple threads. For example if your job used 4 thread by default and you are running two jobs in parallel with -j 2
then you could be using up to 8 threads at a time.