Save contents
You can save all the output from a Terminal tab or window to a text file. This may be useful if you have to submit the terminal output as debugging information.
Go to File.
Select Save Contents….
Choose your desired directory and enter a filename.
Click Save.
You may optionally input a file extension along with the filename, for example .txt. This may be useful if you plan to view the file when using another operating system.