GNU parallel

20 August 2016

GNU parallel is an amazing command line tool for executing jobs in parallel using one or more machines. It has a lot of features and therefore a lot of options. Fortunately the manual page is full of examples.

Simulty revisited

Once I wrote an article about a very simple http-stress-tool simulty. It reads random urls from a file and executes multiple get-requests simultaneously to them. I wrote this script in ruby. Now I try to do the same with parallel:

while true; do awk "NR==$(($RANDOM % `wc -l urls.txt | cut -f 1 -d ' '` +1)){print}" urls.txt; done | parallel -j 100 curl -4

Just one line on the command-line.

[ Linux  Programming  Sysadmin  Bash  One-Liner  Tricks  ]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 Unported License.

Copyright 2015-present Hoti