This part is a basic introduction to show new users the Unix side of Mac OS X. Specifically, this section will cover:
Configuring and using the Terminal
Command-line editing with
tcsh
Additional shell commands, such as
bindkey
,defaults
, andopen
Basic Unix commands
You don’t have to venture into the command line if you don’t want to, but it’s easy to be seduced by its power, as this part shows you a glimpse at what’s possible with just a few easy keystrokes.
The Terminal application
(/Applications/Utilities
) is your interface to
Mac OS X’s Unix shell. The Terminal can be used for
everything from creating new directories (folders) and files to
launching applications, and from managing and monitoring your system
to programming and tweaking your system preferences.
This section offers advice on how to configure the settings for your Terminal. Previously, you would use Terminal → Preferences to configure the Terminal’s settings. However, with Jaguar, you’ll need to use File → Show Info and change the settings from the Terminal Inspector window via the pull-down menu at the top of the window.
- Change the style of the cursor?
- Stop the cursor from blinking?
Display → Cursor Style → Deselect Blinking Cursor.
- Change the background color and font colors of the Terminal window?
Color → click on the color selection boxes next to Background, Cursor, Normal Text, Bold Text, and Selection to open another window with the color wheel, which allows you to change and select a different color and even the transparency of the Terminal window.
- Assign a different title to the Terminal window?
Window → Title.
- Assign a different title to the current Terminal window?
With an open Terminal window, select File → Set Title (Shift-
-T). The Terminal Inspector window will open with Window selected in the pull-down menu. Enter a new title for the window in the Title field and hit Return or Tab to change the title of the current window.
- Specify the number of lines a Terminal window can contain in the scrollback buffer?
Buffer → Buffer Size. You can either specify a number of lines in the field provided (10,000 lines is the default), or select from an unlimited scrollback or no scrollback at all.
- Set the Terminal’s emulation mode to VT100?
Emulation → Strict VT-100 keypad behavior.
- Close the Terminal window after I’ve exited?
Shell → When the shell exits → (select from either “Close the window” or “Close only if the shell exited cleanly”).
- Where is the history file for the shell?
It’s located in your home directory as
.tcsh_history
. The history file keeps track of recently entered commands, which you can recall in a variety of ways, the easiest of which is to use the Up or Down Arrows to go back or forward in the history file, respectively.- Where is the shell’s configuration file located?
- Can I create a customized shell environment that’s different from the one used by other users on the system?
Yes, but read and follow the instructions in the
README
file located in/usr/share/tcsh/examples
.
Table 4-1 lists the keyboard shortcuts that can be used with the Terminal application.
Table 4-1. Keyboard shortcuts for use with the Terminal
Key command |
Description |
---|---|
-. (period) |
Terminate process (same as Control-C, the Unix interrupt command) |
-Up Arrow |
Scrolls up one line at a time |
-Down Arrow |
Scroll down one line at a time |
-Left Arrow |
Go to previous Terminal window |
-Right Arrow |
Go to next Terminal window |
FN-Up Arrow |
Scroll up one screen at a time |
FN-Down Arrow |
Scroll down one screen at a time |
FN-Left Arrow |
Scroll backward to the top of the screen |
FN-Right Arrow |
Scroll forward to the bottom of the screen |
-A |
Select all the text in the Terminal window, including the scrollback |
Shift- -C |
Use to open or close the Colors window |
-I |
Open the Terminal Inspector, which allows you to change some of the Terminal’s settings |
-K |
Clear all the information from the Terminal window, disabling
scrollback (this is different and more extensive than the
|
-N |
Open new Terminal window |
Shift- -N |
Run a command in a new Terminal window |
-S |
Save the settings of the Terminal window as a
|
Shift- -S |
Save the settings of the Terminal window as a differently named
|
Option- -S |
Save the contents of the Terminal window, including any scrollback, as a text file |
Shift-Option- -S |
Save any selected text in the Terminal window as a text file |
-T |
Open the Font panel so you can change the Terminal’s default font settings, including the font family, size, and color |
- |
Switch to a different Terminal window, based on its
|
Get Mac OS X Pocket Guide, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.