You can save custom Terminal window settings as .term files, which are stored in XML format.
Follow these steps to save Terminal window settings as a file:
1. Configure the Terminal window as desired (color, font, size, and so forth).
2. Choose Save from the File menu.
3. Type a unique filename.
4. Choose where you want to save the file. You may save it in the default location (~/Library/Application Support), or in a different location, such as the desktop or your Documents folder. The filename extension ".term" is automatically appended to the filename.
Important: The saved file stores window settings, but not window contents. Instead, choose "Save Text As" from the File menu to save text.
To use a saved .term file, you may double-click it, or choose Open from the File menu in Terminal.
Advanced: executing a command while file opens
To execute a specific command when opening a .term file, add an XML tag to the file with a text editing application such as TextEdit.
For example, if you want connect to a remote server via ssh, add the following to the .term file:
<key>ExecutionString</key>
<string>ssh_login_name@domain_or_address</string>
Note: This document applies to the Terminal application, located in /Applications/Utilities.