$pid = fork(); if( $pid == 0 ){ # This is one process(happens to be child) # Execute command for file 1 } else { # This is the second process(happens to be the parent) # Execute command for file 2 }