Is there a way to run multiple commands at the same time, but not moving on until both are finished? I have been trying to use similar instructions to the following, but both take a long time to complete and would be better if I could run them at the same time (cannot use & to run it on the background since the next step requires all the output files)
sed -i 's/x/y/' file1
grep 'pattern' file2 > file3
( command ). this launches a subshell. it's multi-processing. then you can callwaiton both pid. have a look at a complete doc: tldp.org/LDP/abs/html/index.html.