if you have an executable file with name main then $ nohup ./main &> logfile.txt or if you want to run it with a macro file $ nohup ./main run.mac &> logfile.txt