How to run two commands simultaneously?
Solution 1:
Start up multiple background tasks. This means that the second one does not need to wait for the first one to finish loading. The &
tell the command to run in the background.
From the command-line: In the first one, the number of .
(dots) equals the number of instances.
set "/my/vid/path.mp4"
for i in . . ;do (mplayer "$1" &) ;done
or
set "/my/vid/path.mp4"; (
mplayer "$1" &
mplayer "$1" & )
or
( mplayer "/my/vid/path.mp4" &
mplayer "/my/vid/path.mp4" & )
Or in a script called by play-two "/my/vid/path.mp4"
#!/bin/bash
mplayer "$1" &
mplayer "$1" &
Solution 2:
GNU parallel
In your particular case:
parallel mplayer ::: file1.avi file2.avi