Getting around the Terminal in OS X

The Terminal app in OS X presents an old school command line interface, but sports modern configuration to change the font, background color and other advanced shell options. Go to Terminal app’s Preferences… and click on the Settings tab to configure terminal settings.

Getting around the Terminal in OS X Default Profile

Profiles

Settings are grouped under profiles and Terminal comes with a number of stock profiles such as Basic, Grass, Homebrew, Man Page, Novel etc to get you started. Each profile comes with a separate configuration for the font, background color, window, shell etc settings. You then specify the profile to use when you open a new terminal window.

Getting around the Terminal in OS X using profile

You can specify a profile as default by selecting the profile and click on the Default button at the bottom. The default profile is the settings used when you open a new terminal window using Command-N.

You can add a new profile by clicking on the ‘+’ button. And you can remove a profile using the ‘-‘ button. When creating a new profile, it is advisable to duplicate the settings of one of the stock profile.

Getting around the Terminal in OS X Duplicate Settings

Tabs

It is typical for person who is fluent in using command line to open a number of terminals while working on their Mac. You can open terminals in separate windows, or you can open them in tabs similar to Safari and Finder. Use Command-T to open a new terminal in a tab. 

Getting around the Terminal in OS X Tabs

Give it a try to see if working with tabs suit you better. It is a matter of personal preferences.  

Closing a terminal

You can close a terminal in a window or tab by using Command-W. Or you can simply close the terminal window by clicking on the red close button at top left corner of window. These are OS X system methods of closing window, and is forcefully closing your terminal including any running commands.

To properly end a terminal session, it is a good habit to enter the exit command instead. This will ensure no hanging running process and a clean exit.

Getting around the Terminal in OS X Exit

Once the exit command is entered, bash shell will logout your session and display a message “[Process completed]”.

At this point the terminal is dead and you can no longer enter any further command. The terminal window however is left open and you have to issue Command-W to close it. You can setup your terminal profile so that window is automatically closed after an exit command.

Go to Terminal > Preferences > Settings and select the profile. Under Shell tab for the option When the shell exits, select the option Close if the shell exited cleanly.

Getting around the Terminal in OS X close window

Note: This is a continuation post of a series of tutorials on OS X command line. Please read the post Basic OS X command line utilities and tips to get started.