I have a file which has many links. As an example here is my file:
link1
link2
link3
link4
link5
link6
link7
link8
link9
link10
link11
link12
link13
link14
link15
link16
I want to run a particular command on a single terminal which runs 1st 4 links simultaneously. For example the command I want to run is
wget link1
wget link2
and etc.. but I want to run first 4 links simultaneously. Then if one of the link is finished downloading then the next link(which is link5) should be automatically submitted for download and so on.
I am looking for a way where I am not downloading the links one by one(uses more time), neither I have to open multiple terminals to submit multiple individual links as separate commands. Any help would be really appreciated.
&to the end of a command will give you back the prompt. See shell job control. However using gnu parallel is better (automated).