Saving the commands in file