I am trying to run several shell commands in a parallel way without making background processes using "&". Also, I want to assign one job to one CPU (in a fair way) For example, if I have four cores, I want assign four cmd1 to cmd4 as follows:
CPU #1: cmd1
CPU #2: cmd2
CPU #3: cmd3
CPU #4: cmd4
Could you please let me know ways doing that?
I've found "parallel" command, but I could not figure out how to use it. Also, I've tried the following command: ./cmd1 | ./cmd2 | ./cmd3 | ./cmd4 It seems like that four commands (cmd1 to cmd4) are running in parallel, but I am not sure the jobs are assigned to cores as I said in the above.
Thank you!
Sorry. I am running the commands on linux.