system("ls -l > ls.out"); # you gonna have to wait system("ls -l > ls.out &"); # the command goes into the # background