Quantcast
Channel: Linux and Mac Hacks
Viewing all articles
Browse latest Browse all 39

How to run processes concurrently or simultaneously on Linux aka Instant DDOS

$
0
0
There may be a time that you want to run a script like "dothis.sh" multiple times concurrently (simultaneously) - the following script runs 5 concurrent instances of "dothis.sh":

#!/bin/bash
CONCURRENT_INSTANCES=5
for i in `seq 1 $CONCURRENT_INSTANCES`
do
   /path/to/dothis.sh &
done
You can update CONCURRENT_INSTANCES to be whatever number you desire, but use with caution as you don't want to slam your server.

Viewing all articles
Browse latest Browse all 39

Trending Articles