Chapter 4. Mac OS X Unix Basics

This part of the book serves as a basic introduction to show new users how to use 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, like bindkey, defaults, and open

  • Basic Unix commands

Configuring and Using the Terminal

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 altering your system preferences.

Terminal Settings

This section offers advice on how to configure the settings for your Terminal:

Change the style of the cursor?

Terminal Preferences Text & Colors Cursor Shape (Block, Underline, Vertical Bar)

Stop the cursor from blinking?

Terminal Preferences Text & Colors Options Deselect Blinking Cursor

Change the background color and font colors of the Terminal window?

Terminal Preferences Text & Colors

Assign a different title to the Terminal window?

Terminal Preferences Window Custom Title

Assign a different title to the current Terminal window?

With an open Terminal window, hit Shift-

Terminal Settings

-T (or Shell Set Title). Select the Custom Title checkbox, and enter a new title in the text field.

Specify the number of lines a Terminal window can contain in the scrollback buffer?

Terminal Preferences Buffer Scrollback Buffer

Set the Terminal’s emulation mode to VT100?

Terminal Preferences Emulation Strict VT100 emulation

Note

The interface says the VT100 mode isn’t recommended, but it doesn’t say why.

Close the Terminal window after I’ve exited?

Terminal Preferences Shell Close the window if the shell exited cleanly

Change the shell from its default (tcsh)?

Terminal Preferences Shell Use this shell; change /bin/tcsh to either /bin/csh, /bin/sh, or /bin/zsh

Where is the history file for the shell?

It’s located in your home directory as .tcsh_history.

Where is the shell’s configuration file located?

/usr/share/init/tcsh/rc

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/init/tcsh.

Keyboard Shortcuts

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

Keyboard shortcuts for use with the Terminal

-. (period)

Terminate process (same as Control-C, the Unix interrupt command)

Keyboard shortcuts for use with the Terminal

-A

Select all of the text in the Terminal window

Keyboard shortcuts for use with the Terminal

-Up arrow

Scrolls up one line at a time

Keyboard shortcuts for use with the Terminal

-Down arrow

Scroll down one line at a time

Keyboard shortcuts for use with the Terminal

-I

Open the Terminal Inspector, which allows you to change some of the Terminal’s settings

Keyboard shortcuts for use with the Terminal

-K

Clear all of the information from the Terminal window, disabling scrollback (this is different and more extensive than the clear command, described later)

Keyboard shortcuts for use with the Terminal

-Left arrow

Go to previous Terminal window

Keyboard shortcuts for use with the Terminal

-Right arrow

Go to next Terminal window

FN-Down arrow

Scroll down one screen at a time

FN-Up arrow

Scroll up one screen at a time

Keyboard shortcuts for use with the Terminal

-N

Open new Terminal window

Shift-

Keyboard shortcuts for use with the Terminal

-N

Issue command in a new Terminal window

Keyboard shortcuts for use with the Terminal

-T

Open the Font panel so you can change the Terminal’s default font settings, including the font family, size, and color

Get Mac OS X Pocket Reference 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.