Saves command to file and displays it on the screen